#include <genesis/utils/io/string_input_source.hpp>
Inherits BaseInputSource.
Input source for reading byte data from a string.
The input string is provided via the constructor. It is not owned by this class, thus the owner must keep it alive as long as reading from it is required, and is responsbile for destroying it. This class merely keeps a pointer to it.
That implies that the string shall not be modified while this input source is used, thus, only const-members of the string can be called.
Definition at line 58 of file string_input_source.hpp.
Public Member Functions | |
StringInputSource (char const *str, size_t size) | |
Construct the input source from a char array. More... | |
StringInputSource (std::string const &str) | |
Construct the input source from a std::string . More... | |
StringInputSource (StringInputSource &&)=default | |
StringInputSource (StringInputSource const &)=default | |
~StringInputSource () override | |
StringInputSource & | operator= (StringInputSource &&)=default |
StringInputSource & | operator= (StringInputSource const &)=default |
Public Member Functions inherited from BaseInputSource | |
BaseInputSource ()=default | |
BaseInputSource (BaseInputSource &&)=default | |
BaseInputSource (BaseInputSource const &)=default | |
virtual | ~BaseInputSource () |
bool | is_trivial () const |
Return whether reading from this source is trivial, such as reading from a file, or involves more complex operations, such as reading from a compressed input that needs to be decompressed first. More... | |
BaseInputSource & | operator= (BaseInputSource &&)=default |
BaseInputSource & | operator= (BaseInputSource const &)=default |
size_t | read (char *buffer, size_t size) |
Read size many bytes into the char buffer . More... | |
std::string | source_name () const |
Get a name of the input source. This is intended for user output. More... | |
std::string | source_string () const |
Get a string representing the input source. This is intended for the reader classes, which for example might want to examine the input file name. More... | |
|
inline |
Construct the input source from a char array.
Definition at line 69 of file string_input_source.hpp.
|
inlineexplicit |
Construct the input source from a std::string
.
Definition at line 79 of file string_input_source.hpp.
|
default |
|
default |
|
inlineoverride |
Definition at line 92 of file string_input_source.hpp.
|
default |
|
default |