#include <source/ariba/utility/configuration/ConfigFile.h>
Public Member Functions | |
ConfigFile (string filename, string delimiter="=", string comment="#", string sentry="EndConfigFile") | |
ConfigFile () | |
template<class T> | |
T | read (const string &key) const |
template<class T> | |
T | read (const string &key, const T &value) const |
template<class T> | |
bool | readInto (T &var, const string &key) const |
template<class T> | |
bool | readInto (T &var, const string &key, const T &value) const |
template<class T> | |
void | add (string key, const T &value) |
void | remove (const string &key) |
bool | keyExists (const string &key) const |
string | getDelimiter () const |
string | getComment () const |
string | getSentry () const |
string | setDelimiter (const string &s) |
string | setComment (const string &s) |
Protected Types | |
typedef std::map< string, string >::iterator | mapi |
typedef std::map< string, string >::const_iterator | mapci |
Static Protected Member Functions | |
template<class T> | |
static string | T_as_string (const T &t) |
template<class T> | |
static T | string_as_T (const string &s) |
static void | trim (string &s) |
Protected Attributes | |
string | myDelimiter |
string | myComment |
string | mySentry |
std::map< string, string > | myContents |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ConfigFile &cf) |
std::istream & | operator>> (std::istream &is, ConfigFile &cf) |
Classes | |
struct | file_not_found |
struct | key_not_found |
Definition at line 57 of file ConfigFile.h.
typedef std::map<string,string>::iterator ConfigFile::mapi [protected] |
Definition at line 65 of file ConfigFile.h.
typedef std::map<string,string>::const_iterator ConfigFile::mapci [protected] |
Definition at line 66 of file ConfigFile.h.
ConfigFile::ConfigFile | ( | string | filename, | |
string | delimiter = "=" , |
|||
string | comment = "#" , |
|||
string | sentry = "EndConfigFile" | |||
) |
Definition at line 31 of file ConfigFile.cpp.
ConfigFile::ConfigFile | ( | ) |
Definition at line 45 of file ConfigFile.cpp.
T ConfigFile::read | ( | const string & | key | ) | const [inline] |
Definition at line 177 of file ConfigFile.h.
References myContents.
Referenced by ariba::utility::Configuration::read().
T ConfigFile::read | ( | const string & | key, | |
const T & | value | |||
) | const [inline] |
bool ConfigFile::readInto | ( | T & | var, | |
const string & | key | |||
) | const [inline] |
bool ConfigFile::readInto | ( | T & | var, | |
const string & | key, | |||
const T & | value | |||
) | const [inline] |
void ConfigFile::add | ( | string | key, | |
const T & | value | |||
) | [inline] |
void ConfigFile::remove | ( | const string & | key | ) |
bool ConfigFile::keyExists | ( | const string & | key | ) | const |
Definition at line 60 of file ConfigFile.cpp.
References myContents.
Referenced by ariba::utility::Configuration::exists().
string ConfigFile::getDelimiter | ( | ) | const [inline] |
string ConfigFile::getComment | ( | ) | const [inline] |
string ConfigFile::getSentry | ( | ) | const [inline] |
string ConfigFile::setDelimiter | ( | const string & | s | ) | [inline] |
string ConfigFile::setComment | ( | const string & | s | ) | [inline] |
string ConfigFile::T_as_string | ( | const T & | t | ) | [inline, static, protected] |
bool ConfigFile::string_as_T< bool > | ( | const string & | s | ) | [inline, static, protected] |
Definition at line 136 of file ConfigFile.h.
void ConfigFile::trim | ( | string & | s | ) | [static, protected] |
std::ostream& operator<< | ( | std::ostream & | os, | |
const ConfigFile & | cf | |||
) | [friend] |
Definition at line 78 of file ConfigFile.cpp.
std::istream& operator>> | ( | std::istream & | is, | |
ConfigFile & | cf | |||
) | [friend] |
Definition at line 92 of file ConfigFile.cpp.
string ConfigFile::myDelimiter [protected] |
Definition at line 60 of file ConfigFile.h.
Referenced by getDelimiter(), operator<<(), operator>>(), and setDelimiter().
string ConfigFile::myComment [protected] |
Definition at line 61 of file ConfigFile.h.
Referenced by getComment(), operator>>(), and setComment().
string ConfigFile::mySentry [protected] |
std::map<string,string> ConfigFile::myContents [protected] |
Definition at line 63 of file ConfigFile.h.
Referenced by add(), keyExists(), operator<<(), operator>>(), read(), readInto(), and remove().