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

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

Inherits BaseInputSource.

Detailed Description

Input source for reading byte data from a file.

The input file name is provided via the constructor.

It is also possible to provide a FILE pointer directly. In this case, the ownership of the file pointer is taken by this class. Thus, closing the file is done when destructing this class.

Definition at line 293 of file input_source.hpp.

Public Member Functions

 FileInputSource (std::string const &file_name)
 Construct the input source from a file with the given file name. More...
 
 FileInputSource (std::string const &file_name, FILE *file)
 Construct the input source from a FILE pointer. The file_name is used for the source_name() function only. More...
 
 FileInputSource (FileInputSource const &)=default
 
 FileInputSource (FileInputSource &&)=default
 
 ~FileInputSource ()
 
FileInputSourceoperator= (FileInputSource const &)=default
 
FileInputSourceoperator= (FileInputSource &&)=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

FileInputSource ( std::string const &  file_name)
inlineexplicit

Construct the input source from a file with the given file name.

Definition at line 304 of file input_source.hpp.

FileInputSource ( std::string const &  file_name,
FILE *  file 
)
inlineexplicit

Construct the input source from a FILE pointer. The file_name is used for the source_name() function only.

Definition at line 326 of file input_source.hpp.

FileInputSource ( FileInputSource const &  )
default
FileInputSource ( FileInputSource &&  )
default
~FileInputSource ( )
inline

Definition at line 340 of file input_source.hpp.

Member Function Documentation

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

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

Definition at line 352 of file input_source.hpp.


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