3 #include <filems/read/comps/FileReader.h>
9 namespace helios {
namespace filems{
14 using std::make_shared;
24 template <
typename ReadArg>
55 ios_base::openmode
openMode = ios_base::in
63 ss <<
"SimpleFileReader::SimpleFileReader("
64 <<
"string const &, ios__base::openmode"
65 <<
") failed to open file at path:\n\""
67 throw std::ios_base::failure(ss.str());
Abstract class defining the fundamentals of any file reader.
Definition: FileReader.h:20
virtual void makeStrategy()=0
Build the strategy for the file reader.
shared_ptr< ReadingStrategy< ReadArg > > readingStrategy
The reading strategy to be used by the file reader.
Definition: FileReader.h:32
string path
Path to the file to be read.
Definition: FileReader.h:27
virtual void setPath(string const &path)
Set the path to the file to be read.
Definition: FileReader.h:77
Abstract class defining the fundamental of any file reader that uses standard file input stream as re...
Definition: SimpleFileReader.h:25
void setPath(string const &path) override
Set the path to the file to be read, also opening the input stream for the new file and updating the ...
Definition: SimpleFileReader.h:91
ReadArg read() override
Read from file simply by applying the reading strategy. Therefore, there is no concurrency handling m...
Definition: SimpleFileReader.h:81
ifstream ifs
The input file stream to read from.
Definition: SimpleFileReader.h:37
SimpleFileReader(string const &path, ios_base::openmode openMode=ios_base::in)
Default constructor for simple file reader.
Definition: SimpleFileReader.h:53
ios_base::openmode openMode
The open mode flags for the input file stream.
Definition: SimpleFileReader.h:42