VoiceMan
|
The class to parse file with colon-delimited lines. More...
Public Member Functions | |
std::string | getItem (size_t lineIndex, size_t itemIndex) const |
Returns the required delimited item in required line. | |
size_t | getItemCountInLine (size_t index) const |
Returns the number of delimited items in specified line. | |
size_t | getLineCount () const |
The number of non-empty and non-commented lines read from source file. | |
std::string | getRawLine (size_t index) const |
Returns text file line without any translations. | |
void | read (const std::string &fileName) |
Reads and stores data from file. |
VoiceMan daemon uses set of data tables stored in colon-delimited files. Each line in these files contains some items, delimited by ":" character. This class parses colon-delimited files and extracts stored data.
std::string DelimitedFile::getItem | ( | size_t | lineIndex, |
size_t | itemIndex | ||
) | const |
Use this method to get colon-delimited item in line.
[in] | lineIndex | The desired index of line |
[in] | itemIndex | The number of desired item in specified line |
size_t DelimitedFile::getItemCountInLine | ( | size_t | index | ) | const |
Use this method to get number of items in specified line.
[in] | index | The number of a line to count items in |
size_t DelimitedFile::getLineCount | ( | ) | const |
Use this method to get number of accessible lines.
std::string DelimitedFile::getRawLine | ( | size_t | index | ) | const |
Use this method to get line as it is stored in lines vector.
[in] | index | The index of a line to return |
void DelimitedFile::read | ( | const std::string & | fileName | ) |
This method can be called multiple times to read sequentially more than one file. Results of previous operation are silently cleaned.
[in] | fileName | The name of a file to read data from |