#include <ConfigFile.hh>
Public Member Functions | |
ConfigFile (const string &name) | |
bool | GetLine (string &str) |
int | GetLineCnt () |
~ConfigFile () | |
Private Member Functions | |
bool | IsComment (string &str) |
void | RemoveEOL (string &str) |
Private Attributes | |
fstream | file |
int | line_cnt |
Definition at line 14 of file ConfigFile.hh.
P::ConfigFile::ConfigFile | ( | const string & | name | ) |
Definition at line 11 of file ConfigFile.cc.
Definition at line 19 of file ConfigFile.cc.
bool P::ConfigFile::GetLine | ( | string & | str | ) |
Reads the next line of a file into the given string ignoring comment lines. Returns 'true' if the line was filled. 'false' otherwise (i.e. if EOF was reached). The newline character is NOT appended. If the file was not opened readable then an exception is thrown.
Definition at line 30 of file ConfigFile.cc.
int P::ConfigFile::GetLineCnt | ( | ) | [inline] |
Definition at line 27 of file ConfigFile.hh.
bool P::ConfigFile::IsComment | ( | string & | str | ) | [private] |
Returns true if the line is a comment line. Comment lines are empty lines or start with "#".
Definition at line 63 of file ConfigFile.cc.
void P::ConfigFile::RemoveEOL | ( | string & | str | ) | [private] |
Remove end of line Note that end of line may be `
` (newline, unix style) or '' (carriage return, dos style, wrong! very very wrong!!) We have to check for both.
Definition at line 52 of file ConfigFile.cc.
fstream P::ConfigFile::file [private] |
Definition at line 17 of file ConfigFile.hh.
int P::ConfigFile::line_cnt [private] |
Definition at line 18 of file ConfigFile.hh.