#include <genesis/utils/io/file_input_source.hpp>
Inherits BaseInputSource.
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 60 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 | |
FileInputSource & | operator= (FileInputSource &&)=default |
FileInputSource & | operator= (FileInputSource 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... | |
|
inlineexplicit |
Construct the input source from a file with the given file name.
Definition at line 71 of file file_input_source.hpp.
|
inlineexplicit |
Construct the input source from a FILE
pointer. The file_name
is used for the source_name() function only.
Definition at line 86 of file file_input_source.hpp.
|
default |
|
default |
|
inlineoverride |
Definition at line 100 of file file_input_source.hpp.
|
default |
|
default |