#include <Puma/StringSource.h>
String input source implementation implementing the Source interface.
|
| | StringSource () |
| | Construct an empty string input source.
|
| |
| | StringSource (const char *string) |
| | Construct an input source for the given string.
|
| |
| virtual int | read (char *dest, int n) |
| | Read n bytes from the input string into the given string.
|
| |
| void | string (const char *string) |
| | Set the input string to read from.
|
| |
| const char * | string () |
| | Get the input string.
|
| |
| int | size () |
| | Get the size of the input string.
|
| |
| | Source () |
| | Constructs an empty source object.
|
| |
| virtual | ~Source () |
| | Destroys the source object.
|
| |
◆ StringSource() [1/2]
| Puma::StringSource::StringSource |
( |
| ) |
|
|
inline |
Construct an empty string input source.
◆ StringSource() [2/2]
| Puma::StringSource::StringSource |
( |
const char * | string | ) |
|
|
inline |
Construct an input source for the given string.
- Parameters
-
| string | The string from which to read. |
◆ read()
| virtual int Puma::StringSource::read |
( |
char * | dest, |
|
|
int | n ) |
|
inlinevirtual |
Read n bytes from the input string into the given string.
- Parameters
-
| dest | The string used as buffer for the bytes read. |
| n | The number of bytes to read. |
- Returns
- The number of bytes read, or -1 in case of errors.
Implements Puma::Source.
◆ size()
| int Puma::StringSource::size |
( |
| ) |
|
|
inlinevirtual |
Get the size of the input string.
- Returns
- The size of the input string, or -1 if no input string set.
Reimplemented from Puma::Source.
◆ string() [1/2]
| const char * Puma::StringSource::string |
( |
| ) |
|
|
inline |
Get the input string.
- Returns
- The input string, or null if no input string set.
◆ string() [2/2]
| void Puma::StringSource::string |
( |
const char * | string | ) |
|
|
inline |
Set the input string to read from.
- Parameters
-