CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Base class that regroups common reader functionalities.
Definition at line 42 of file FileReader.hpp.
#include <FileReader.hpp>
Public Member Functions | |
FileReader () | |
Alternative constructor. More... | |
FileReader (const CepsString &fileName) | |
Default constructor. More... | |
FileReader (const FileReader &that) | |
Copy constructor. More... | |
FileReader & | operator= (const FileReader &that) |
Copy constructor. More... | |
virtual | ~FileReader () |
Destructor. Calls FileReader::close. More... | |
void | setFileName (const CepsString &fileName) |
Set file to read. More... | |
virtual CepsBool | open () |
Opens the designated file in read mode. More... | |
virtual void | close () |
Close the file. More... | |
virtual CepsBool | good () |
true if stream is still readable More... | |
void | reset () |
Set file stream to the beginning of the file. More... | |
CepsUInt | find (const CepsString &pattern) |
Advance stream until pattern is found. More... | |
CepsBool | findNext (const CepsString &pattern) |
Advance stream until pattern is found. More... | |
CepsUInt | findNextOf (const CepsVector< CepsString > &patterns) |
Advance stream until one of patterns is found. More... | |
CepsString | getFileName () |
Name of parsed file. More... | |
CepsUInt | skipLines (CepsUInt nbLines) |
Skip given number of lines. More... | |
void | oneLine (CepsString &line) |
Get one line from the stream. More... | |
template<typename T > | |
FileReader & | operator>> (T &var) |
Reading operator. More... | |
CepsInt | lineIndex (const CepsString &word) |
Index of first line starting with word, search starting from the current stream position. More... | |
CepsUInt | checkEOF () |
Checks if the reader reached end of file. More... | |
Protected Attributes | |
CepsString | m_fileName |
file to open More... | |
std::ifstream | m_file |
stream More... | |
FileReader::FileReader | ( | ) |
Alternative constructor.
Definition at line 36 of file FileReader.cpp.
|
explicit |
Default constructor.
The designated file is not opened.
fileName | the file the reader is meant to read |
Definition at line 40 of file FileReader.cpp.
FileReader::FileReader | ( | const FileReader & | that | ) |
Copy constructor.
Definition at line 45 of file FileReader.cpp.
|
virtual |
Destructor. Calls FileReader::close.
Definition at line 58 of file FileReader.cpp.
CepsUInt FileReader::checkEOF | ( | ) |
Checks if the reader reached end of file.
Definition at line 228 of file FileReader.cpp.
|
virtual |
Close the file.
Definition at line 84 of file FileReader.cpp.
CepsUInt FileReader::find | ( | const CepsString & | pattern | ) |
Advance stream until pattern is found.
Definition at line 131 of file FileReader.cpp.
CepsBool FileReader::findNext | ( | const CepsString & | pattern | ) |
Advance stream until pattern is found.
Definition at line 107 of file FileReader.cpp.
CepsUInt FileReader::findNextOf | ( | const CepsVector< CepsString > & | patterns | ) |
Advance stream until one of patterns is found.
Definition at line 154 of file FileReader.cpp.
CepsString FileReader::getFileName | ( | ) |
Name of parsed file.
Definition at line 173 of file FileReader.cpp.
|
virtual |
true if stream is still readable
Definition at line 92 of file FileReader.cpp.
CepsInt FileReader::lineIndex | ( | const CepsString & | word | ) |
Index of first line starting with word, search starting from the current stream position.
Definition at line 209 of file FileReader.cpp.
void FileReader::oneLine | ( | CepsString & | line | ) |
Get one line from the stream.
Definition at line 202 of file FileReader.cpp.
|
virtual |
Opens the designated file in read mode.
Reimplemented in TetgenMeshReader.
Definition at line 70 of file FileReader.cpp.
FileReader & FileReader::operator= | ( | const FileReader & | that | ) |
Copy constructor.
Definition at line 51 of file FileReader.cpp.
|
inline |
Reading operator.
Definition at line 126 of file FileReader.hpp.
void FileReader::reset | ( | ) |
Set file stream to the beginning of the file.
Definition at line 98 of file FileReader.cpp.
void FileReader::setFileName | ( | const CepsString & | fileName | ) |
Set file to read.
Definition at line 63 of file FileReader.cpp.
Skip given number of lines.
Definition at line 179 of file FileReader.cpp.
|
protected |
stream
Definition at line 146 of file FileReader.hpp.
|
protected |
file to open
Definition at line 145 of file FileReader.hpp.