Reads and writes a configuration file.
More...
#include <ConfigFile.hpp>
|
template<class T > |
void | add (string key, const T &value) |
|
template<class T > |
void | add (string sectionKey, string key, const T &value) |
|
| ConfigFile (string filename, string filepath="../config/", string delimiter="=", string comment="#", string sectionStartTag="[", string sectionEndTag="]", string sentry="EndConfigFile") |
|
| ConfigFile () |
|
string | getComment () const |
|
string | getDelimiter () const |
|
string | getSentry () const |
|
bool | keyExists (const string &key) const |
|
bool | keyExists (const string §ionKey, const string &key) |
|
template<class T > |
T | read (const string &key, const T &value) const |
|
template<class T > |
T | read (const string &key) const |
|
template<class T > |
T | read (const string §ionKey, const string &key) |
|
template<class T > |
bool | readInto (T &var, const string &key) const |
|
template<class T > |
bool | readInto (T &var, const string §ionKey, const string &key) |
|
template<class T > |
bool | readInto (T &var, const string &key, const T &value) const |
|
void | remove (const string &key) |
|
void | remove (const string §ionKey, const string &key) |
|
void | save () |
|
bool | sectionExists (const string §ionKey) |
|
string | setComment (const string &s) |
|
string | setDelimiter (const string &s) |
|
| ~ConfigFile () |
|
|
typedef std::map< string, string >::const_iterator | mapci |
|
typedef std::map< string, map< string, string > >::const_iterator | mapciSect |
|
typedef std::map< string, string >::iterator | mapi |
|
|
template<class T > |
static T | string_as_T (const string &s) |
|
template<class T > |
static string | T_as_string (const T &t) |
|
static void | trim (string &s) |
|
Reads and writes a configuration file.
Definition at line 125 of file ConfigFile.hpp.
youbot::ConfigFile::ConfigFile |
( |
string |
filename, |
|
|
string |
filepath = "../config/" , |
|
|
string |
delimiter = "=" , |
|
|
string |
comment = "#" , |
|
|
string |
sectionStartTag = "[" , |
|
|
string |
sectionEndTag = "]" , |
|
|
string |
sentry = "EndConfigFile" |
|
) |
| |
youbot::ConfigFile::ConfigFile |
( |
| ) |
|
youbot::ConfigFile::~ConfigFile |
( |
| ) |
|
|
inline |
template<class T >
void youbot::ConfigFile::add |
( |
string |
key, |
|
|
const T & |
value |
|
) |
| |
template<class T >
void youbot::ConfigFile::add |
( |
string |
sectionKey, |
|
|
string |
key, |
|
|
const T & |
value |
|
) |
| |
string youbot::ConfigFile::getComment |
( |
| ) |
const |
|
inline |
string youbot::ConfigFile::getDelimiter |
( |
| ) |
const |
|
inline |
string youbot::ConfigFile::getSentry |
( |
| ) |
const |
|
inline |
bool youbot::ConfigFile::keyExists |
( |
const string & |
key | ) |
const |
bool youbot::ConfigFile::keyExists |
( |
const string & |
sectionKey, |
|
|
const string & |
key |
|
) |
| |
template<class T >
T youbot::ConfigFile::read |
( |
const string & |
key, |
|
|
const T & |
value |
|
) |
| const |
template<class T >
T youbot::ConfigFile::read |
( |
const string & |
key | ) |
const |
template<class T >
T youbot::ConfigFile::read |
( |
const string & |
sectionKey, |
|
|
const string & |
key |
|
) |
| |
template<class T >
bool youbot::ConfigFile::readInto |
( |
T & |
var, |
|
|
const string & |
key |
|
) |
| const |
template<class T >
bool youbot::ConfigFile::readInto |
( |
T & |
var, |
|
|
const string & |
sectionKey, |
|
|
const string & |
key |
|
) |
| |
template<class T >
bool youbot::ConfigFile::readInto |
( |
T & |
var, |
|
|
const string & |
key, |
|
|
const T & |
value |
|
) |
| const |
void youbot::ConfigFile::remove |
( |
const string & |
key | ) |
|
void youbot::ConfigFile::remove |
( |
const string & |
sectionKey, |
|
|
const string & |
key |
|
) |
| |
void youbot::ConfigFile::save |
( |
| ) |
|
bool youbot::ConfigFile::sectionExists |
( |
const string & |
sectionKey | ) |
|
string youbot::ConfigFile::setComment |
( |
const string & |
s | ) |
|
|
inline |
string youbot::ConfigFile::setDelimiter |
( |
const string & |
s | ) |
|
|
inline |
template<class T >
T youbot::ConfigFile::string_as_T |
( |
const string & |
s | ) |
|
|
staticprotected |
template<>
string youbot::ConfigFile::string_as_T |
( |
const string & |
s | ) |
|
|
inlineprotected |
template<>
bool youbot::ConfigFile::string_as_T |
( |
const string & |
s | ) |
|
|
inlineprotected |
template<class T >
string youbot::ConfigFile::T_as_string |
( |
const T & |
t | ) |
|
|
staticprotected |
void youbot::ConfigFile::trim |
( |
string & |
s | ) |
|
|
staticprotected |
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
ConfigFile & |
cf |
|
) |
| |
|
friend |
std::istream& operator>> |
( |
std::istream & |
is, |
|
|
ConfigFile & |
cf |
|
) |
| |
|
friend |
string youbot::ConfigFile::myComment |
|
protected |
std::map<string, string> youbot::ConfigFile::myContents |
|
protected |
string youbot::ConfigFile::myDelimiter |
|
protected |
string youbot::ConfigFile::myFilepath |
|
protected |
string youbot::ConfigFile::mySectionEndTag |
|
protected |
std::map<string, std::map<string, string> > youbot::ConfigFile::mySectionRelatedContents |
|
protected |
string youbot::ConfigFile::mySectionStartTag |
|
protected |
string youbot::ConfigFile::mySentry |
|
protected |
The documentation for this class was generated from the following files: