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

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

Detailed Description

Definition at line 218 of file utils/io/serializer.hpp.

Public Member Functions

 Deserializer (std::string const &file_name)
 
 Deserializer (std::istream &instream)
 
bool finished () const
 
template<typename T >
get_float ()
 Read a floating point number from the stream and return it. More...
 
template<typename T >
void get_float (T &res)
 Read an floating point number from the stream and store it in the result. More...
 
template<typename T >
get_int ()
 Read an integer number from the stream and return it. More...
 
template<typename T >
void get_int (T &res)
 Read an integer number from the stream and store it in the result. More...
 
bool get_null (size_t n)
 Reads n bytes from the stream and returns whether all of them are \0 bytes. More...
 
template<typename T >
get_plain ()
 Read as many bytes from the stream as the type T holds, and return them in form of a value of type T. More...
 
template<typename T >
void get_plain (T &res)
 Read as many bytes from the stream as the type T holds, and put them in the result value of type T. More...
 
void get_raw (char *buffer, size_t n)
 Read n bytes from the stream and store them in the buffer. More...
 
std::string get_raw_string (size_t n)
 Read n bytes from the stream and return them as a string. More...
 
std::string get_string ()
 Read a string from the stream, provided that its length it written preceding it, as done by put_string(). More...
 
 operator bool () const
 

Constructor & Destructor Documentation

Deserializer ( std::string const &  file_name)
inline

Definition at line 226 of file utils/io/serializer.hpp.

Deserializer ( std::istream &  instream)
inline

Definition at line 234 of file utils/io/serializer.hpp.

Member Function Documentation

bool finished ( ) const
inline

Definition at line 276 of file utils/io/serializer.hpp.

T get_float ( )
inline

Read a floating point number from the stream and return it.

Definition at line 400 of file utils/io/serializer.hpp.

void get_float ( T &  res)
inline

Read an floating point number from the stream and store it in the result.

Definition at line 409 of file utils/io/serializer.hpp.

T get_int ( )
inline

Read an integer number from the stream and return it.

Definition at line 382 of file utils/io/serializer.hpp.

void get_int ( T &  res)
inline

Read an integer number from the stream and store it in the result.

Definition at line 391 of file utils/io/serializer.hpp.

bool get_null ( size_t  n)
inline

Reads n bytes from the stream and returns whether all of them are \0 bytes.

Definition at line 318 of file utils/io/serializer.hpp.

T get_plain ( )
inline

Read as many bytes from the stream as the type T holds, and return them in form of a value of type T.

Definition at line 361 of file utils/io/serializer.hpp.

void get_plain ( T &  res)
inline

Read as many bytes from the stream as the type T holds, and put them in the result value of type T.

Definition at line 373 of file utils/io/serializer.hpp.

void get_raw ( char *  buffer,
size_t  n 
)
inline

Read n bytes from the stream and store them in the buffer.

The buffer needs to be big enough to hold n bytes.

Definition at line 304 of file utils/io/serializer.hpp.

std::string get_raw_string ( size_t  n)
inline

Read n bytes from the stream and return them as a string.

Definition at line 335 of file utils/io/serializer.hpp.

std::string get_string ( )
inline

Read a string from the stream, provided that its length it written preceding it, as done by put_string().

Definition at line 349 of file utils/io/serializer.hpp.

operator bool ( ) const
inline

Definition at line 246 of file utils/io/serializer.hpp.


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