Jafar
|
Read a file containing simple key value statements. More...
Read a file containing simple key value statements.
Definition at line 20 of file keyValueFile.hpp.
#include <keyValueFile.hpp>
Public Member Functions | |
KeyValueFile (std::string const &keyValueSeparator_=":", char commentPrefix_= '#') | |
void | readFile (std::string const &filename) |
Parse file filename for key:value pairs. | |
void | writeFile (std::string const &filename) |
Write file filename with key:value pairs. | |
bool | hasKey (std::string const &key) const |
template<class T > | |
void | getItem (std::string const &key, T &value) const |
get the value of item key. | |
template<class T > | |
void | getItem (std::string const &key, T &value, std::string default_value) const |
get the value of item key with default value if does not exist | |
template<class T > | |
void | setItem (std::string const &key, const T &value) |
set the value of item key. | |
Private Types | |
typedef std::map< std::string, std::string > | KeyValueMap |
Private Attributes | |
std::string | keyValueSeparator |
Key value separators, default to ":". | |
char | commentPrefix |
KeyValueMap | keyValue |
void jafar::kernel::KeyValueFile::writeFile | ( | std::string const & | filename | ) |
Write file filename with key:value pairs.
The current date is added in comment at the top of the file.
Generated on Wed Oct 15 2014 00:37:40 for Jafar by doxygen 1.7.6.1 |