A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StringInputSource Class Reference

#include <genesis/utils/io/input_source.hpp>

Inherits BaseInputSource.

Detailed Description

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 121 of file 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 const &)=default
 
 StringInputSource (StringInputSource &&)=default
 
 ~StringInputSource ()
 
StringInputSourceoperator= (StringInputSource const &)=default
 
StringInputSourceoperator= (StringInputSource &&)=default
 
void rewind ()
 Rewind the source to its start, so that it can be re-read. More...
 
- Public Member Functions inherited from BaseInputSource
 BaseInputSource ()=default
 
 BaseInputSource (BaseInputSource const &)=default
 
 BaseInputSource (BaseInputSource &&)=default
 
virtual ~BaseInputSource ()
 
BaseInputSourceoperator= (BaseInputSource const &)=default
 
BaseInputSourceoperator= (BaseInputSource &&)=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. Mainly interesting for user output. More...
 

Constructor & Destructor Documentation

StringInputSource ( char const *  str,
size_t  size 
)
inline

Construct the input source from a char array.

Definition at line 132 of file input_source.hpp.

StringInputSource ( std::string const &  str)
inline

Construct the input source from a std::string.

Definition at line 142 of file input_source.hpp.

StringInputSource ( StringInputSource const &  )
default
~StringInputSource ( )
inline

Definition at line 155 of file input_source.hpp.

Member Function Documentation

StringInputSource& operator= ( StringInputSource const &  )
default
StringInputSource& operator= ( StringInputSource &&  )
default
void rewind ( )
inline

Rewind the source to its start, so that it can be re-read.

Definition at line 165 of file input_source.hpp.


The documentation for this class was generated from the following file: