A class for parsing text files, returning each non-empty and non-comment line, along its line number.
Lines are strip out of leading and trailing whitespaces. By default, lines starting with either "#", "//" or "%" are skipped as comment lines, unless this behavior is explicitly disabled with enableCommentFilters.
|Default constructor; should call open() at some moment later. More...|
|CTextFileLinesParser (const std::string &fil)|
|Constructor for opening a file. More...|
|void||open (const std::string &fil)|
|Open a file (an alternative to the constructor with a file name) More...|
|Close the file (no need to call it normally, the file is closed upon destruction) More...|
|Reset the read pointer to the beginning of the file. More...|
|bool||getNextLine (std::string &out_str)|
|Reads from the file and return the next (non-comment) line, as a std::string. More...|
|bool||getNextLine (std::istringstream &buf)|
|Reads from the file and stores the next (non-comment) line into the given stream buffer. More...|
|size_t||getCurrentLineNumber () const|
|Return the line number of the last line returned with getNextLine. More...|
|void||enableCommentFilters (bool filter_MATLAB_comments, bool filter_C_comments, bool filter_SH_comments)|
|Enable/disable filtering of lines starting with "%", "//" or "#", respectively. More...|
|CTextFileLinesParser::CTextFileLinesParser||(||const std::string &||fil||)|
Return the line number of the last line returned with getNextLine.
|bool CTextFileLinesParser::getNextLine||(||std::string &||out_str||)|
Reads from the file and return the next (non-comment) line, as a std::string.
|bool CTextFileLinesParser::getNextLine||(||std::istringstream &||buf||)|
Reset the read pointer to the beginning of the file.
|Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019|