A library for working with phylogenetic and population genetic data.
v0.27.0
FileInputSource Class Referencefinal

#include <genesis/utils/io/file_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 59 of file file_input_source.hpp.

Public Member Functions

 FileInputSource (FileInputSource &&)=default
 
 FileInputSource (FileInputSource const &)=default
 
 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 () override=default
 
FileInputSourceoperator= (FileInputSource &&)=default
 
FileInputSourceoperator= (FileInputSource const &)=default
 
- Public Member Functions inherited from BaseInputSource
 BaseInputSource ()=default
 
 BaseInputSource (BaseInputSource &&)=default
 
 BaseInputSource (BaseInputSource const &)=default
 
virtual ~BaseInputSource ()
 
BaseInputSourceoperator= (BaseInputSource &&)=default
 
BaseInputSourceoperator= (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...
 

Constructor & Destructor Documentation

◆ FileInputSource() [1/4]

FileInputSource ( std::string const &  file_name)
inlineexplicit

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

Definition at line 70 of file file_input_source.hpp.

◆ FileInputSource() [2/4]

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 82 of file file_input_source.hpp.

◆ FileInputSource() [3/4]

FileInputSource ( FileInputSource const &  )
default

◆ FileInputSource() [4/4]

FileInputSource ( FileInputSource &&  )
default

◆ ~FileInputSource()

~FileInputSource ( )
overridedefault

Member Function Documentation

◆ operator=() [1/2]

FileInputSource& operator= ( FileInputSource &&  )
default

◆ operator=() [2/2]

FileInputSource& operator= ( FileInputSource const &  )
default

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