#include <ConfigFile.hpp>
Public Member Functions | |
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=NULL, 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 () | |
Protected Types | |
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 |
Static Protected Member Functions | |
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) |
Protected Attributes | |
string | myComment |
std::map< string, string > | myContents |
string | myDelimiter |
string | myFilepath |
string | mySectionEndTag |
std::map< string, std::map < string, string > > | mySectionRelatedContents |
string | mySectionStartTag |
string | mySentry |
std::vector< SortTreeVector > | mySortVector |
SortTreeVector * | mySortVectorObj |
Friends | |
std::ostream & | operator<< (std::ostream &os, ConfigFile &cf) |
std::istream & | operator>> (std::istream &is, ConfigFile &cf) |
Reads and writes a configuration file
Definition at line 137 of file ConfigFile.hpp.
typedef std::map<string, string>::const_iterator youbot::ConfigFile::mapci [protected] |
Definition at line 155 of file ConfigFile.hpp.
typedef std::map<string, map<string, string> >::const_iterator youbot::ConfigFile::mapciSect [protected] |
Definition at line 156 of file ConfigFile.hpp.
typedef std::map<string, string>::iterator youbot::ConfigFile::mapi [protected] |
Definition at line 154 of file ConfigFile.hpp.
youbot::ConfigFile::ConfigFile | ( | string | filename, |
string | filepath = NULL , |
||
string | delimiter = "=" , |
||
string | comment = "#" , |
||
string | sectionStartTag = "[" , |
||
string | sectionEndTag = "]" , |
||
string | sentry = "EndConfigFile" |
||
) |
Definition at line 10 of file ConfigFile.cpp.
Definition at line 39 of file ConfigFile.cpp.
youbot::ConfigFile::~ConfigFile | ( | ) | [inline] |
Definition at line 165 of file ConfigFile.hpp.
void youbot::ConfigFile::add | ( | string | key, |
const T & | value | ||
) |
Definition at line 392 of file ConfigFile.hpp.
void youbot::ConfigFile::add | ( | string | sectionKey, |
string | key, | ||
const T & | value | ||
) |
Definition at line 409 of file ConfigFile.hpp.
string youbot::ConfigFile::getComment | ( | ) | const [inline] |
Definition at line 224 of file ConfigFile.hpp.
string youbot::ConfigFile::getDelimiter | ( | ) | const [inline] |
Definition at line 219 of file ConfigFile.hpp.
string youbot::ConfigFile::getSentry | ( | ) | const [inline] |
Definition at line 229 of file ConfigFile.hpp.
bool youbot::ConfigFile::keyExists | ( | const string & | key | ) | const |
Definition at line 81 of file ConfigFile.cpp.
bool youbot::ConfigFile::keyExists | ( | const string & | sectionKey, |
const string & | key | ||
) |
Definition at line 88 of file ConfigFile.cpp.
T youbot::ConfigFile::read | ( | const string & | key, |
const T & | value | ||
) | const |
Definition at line 335 of file ConfigFile.hpp.
T youbot::ConfigFile::read | ( | const string & | key | ) | const |
Definition at line 311 of file ConfigFile.hpp.
T youbot::ConfigFile::read | ( | const string & | sectionKey, |
const string & | key | ||
) |
Definition at line 320 of file ConfigFile.hpp.
bool youbot::ConfigFile::readInto | ( | T & | var, |
const string & | key | ||
) | const |
Definition at line 346 of file ConfigFile.hpp.
bool youbot::ConfigFile::readInto | ( | T & | var, |
const string & | sectionKey, | ||
const string & | key | ||
) |
Definition at line 366 of file ConfigFile.hpp.
bool youbot::ConfigFile::readInto | ( | T & | var, |
const string & | key, | ||
const T & | value | ||
) | const |
void youbot::ConfigFile::remove | ( | const string & | key | ) |
Definition at line 46 of file ConfigFile.cpp.
void youbot::ConfigFile::remove | ( | const string & | sectionKey, |
const string & | key | ||
) |
Definition at line 53 of file ConfigFile.cpp.
void youbot::ConfigFile::save | ( | ) |
Definition at line 72 of file ConfigFile.cpp.
bool youbot::ConfigFile::sectionExists | ( | const string & | sectionKey | ) |
Definition at line 101 of file ConfigFile.cpp.
string youbot::ConfigFile::setComment | ( | const string & | s | ) | [inline] |
Definition at line 241 of file ConfigFile.hpp.
string youbot::ConfigFile::setDelimiter | ( | const string & | s | ) | [inline] |
Definition at line 234 of file ConfigFile.hpp.
bool youbot::ConfigFile::string_as_T< bool > | ( | const string & | s | ) | [inline, static, protected] |
Definition at line 274 of file ConfigFile.hpp.
string youbot::ConfigFile::T_as_string | ( | const T & | t | ) | [static, protected] |
Definition at line 263 of file ConfigFile.hpp.
void youbot::ConfigFile::trim | ( | string & | s | ) | [static, protected] |
Definition at line 113 of file ConfigFile.cpp.
std::ostream& operator<< | ( | std::ostream & | os, |
ConfigFile & | cf | ||
) | [friend] |
Definition at line 121 of file ConfigFile.cpp.
std::istream& operator>> | ( | std::istream & | is, |
ConfigFile & | cf | ||
) | [friend] |
Definition at line 160 of file ConfigFile.cpp.
string youbot::ConfigFile::myComment [protected] |
Definition at line 142 of file ConfigFile.hpp.
std::map<string, string> youbot::ConfigFile::myContents [protected] |
Definition at line 149 of file ConfigFile.hpp.
string youbot::ConfigFile::myDelimiter [protected] |
Definition at line 141 of file ConfigFile.hpp.
string youbot::ConfigFile::myFilepath [protected] |
Definition at line 146 of file ConfigFile.hpp.
string youbot::ConfigFile::mySectionEndTag [protected] |
Definition at line 144 of file ConfigFile.hpp.
std::map<string, std::map<string, string> > youbot::ConfigFile::mySectionRelatedContents [protected] |
Definition at line 150 of file ConfigFile.hpp.
string youbot::ConfigFile::mySectionStartTag [protected] |
Definition at line 143 of file ConfigFile.hpp.
string youbot::ConfigFile::mySentry [protected] |
Definition at line 145 of file ConfigFile.hpp.
std::vector<SortTreeVector> youbot::ConfigFile::mySortVector [protected] |
Definition at line 152 of file ConfigFile.hpp.
SortTreeVector* youbot::ConfigFile::mySortVectorObj [protected] |
Definition at line 147 of file ConfigFile.hpp.