#include <ConfigurationFile.hh>
Classes | |
struct | file_not_found |
struct | key_not_found |
Public Member Functions | |
ConfigurationFile () | |
void | init (const string &filename, const string &delimiter="=", const string &comment="#", const string &sentry="EndConfigurationFile") |
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 ConfigurationFile &cf) |
std::istream & | operator>> (std::istream &is, ConfigurationFile &cf) |
Configuration file of settings for analyses etc. This is not really in the spirit of the framework, in which an analysis should be contained within a single file as much as possible. This will be removed at some point!
Definition at line 65 of file ConfigurationFile.hh.
typedef std::map<string,string>::const_iterator ForIA::ConfigurationFile::mapci [protected] |
Definition at line 74 of file ConfigurationFile.hh.
typedef std::map<string,string>::iterator ForIA::ConfigurationFile::mapi [protected] |
Definition at line 73 of file ConfigurationFile.hh.
ForIA::ConfigurationFile::ConfigurationFile | ( | ) |
Definition at line 25 of file ConfigurationFile.cxx.
void ForIA::ConfigurationFile::add | ( | string | key, |
const T & | value | ||
) |
Definition at line 240 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::getComment | ( | ) | const [inline] |
Definition at line 105 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::getDelimiter | ( | ) | const [inline] |
Definition at line 104 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::getSentry | ( | ) | const [inline] |
Definition at line 106 of file ConfigurationFile.hh.
void ForIA::ConfigurationFile::init | ( | const string & | filename, |
const string & | delimiter = "=" , |
||
const string & | comment = "#" , |
||
const string & | sentry = "EndConfigurationFile" |
||
) |
Definition at line 31 of file ConfigurationFile.cxx.
bool ForIA::ConfigurationFile::keyExists | ( | const string & | key ) | const |
Definition at line 55 of file ConfigurationFile.cxx.
T ForIA::ConfigurationFile::read | ( | const string & | key ) | const |
Definition at line 190 of file ConfigurationFile.hh.
T ForIA::ConfigurationFile::read | ( | const string & | key, |
const T & | value | ||
) | const |
Definition at line 200 of file ConfigurationFile.hh.
bool ForIA::ConfigurationFile::readInto | ( | T & | var, |
const string & | key | ||
) | const |
Definition at line 211 of file ConfigurationFile.hh.
bool ForIA::ConfigurationFile::readInto | ( | T & | var, |
const string & | key, | ||
const T & | value | ||
) | const |
Definition at line 224 of file ConfigurationFile.hh.
void ForIA::ConfigurationFile::remove | ( | const string & | key ) |
Definition at line 47 of file ConfigurationFile.cxx.
string ForIA::ConfigurationFile::setComment | ( | const string & | s ) | [inline] |
Definition at line 109 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::setDelimiter | ( | const string & | s ) | [inline] |
Definition at line 107 of file ConfigurationFile.hh.
bool ForIA::ConfigurationFile::string_as_T< bool > | ( | const string & | s ) | [inline, static, protected] |
Definition at line 149 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::T_as_string | ( | const T & | t ) | [static, protected] |
Definition at line 137 of file ConfigurationFile.hh.
void ForIA::ConfigurationFile::trim | ( | string & | s ) | [static, protected] |
Definition at line 64 of file ConfigurationFile.cxx.
std::ostream& operator<< | ( | std::ostream & | os, |
const ConfigurationFile & | cf | ||
) | [friend] |
Definition at line 73 of file ConfigurationFile.cxx.
std::istream& operator>> | ( | std::istream & | is, |
ConfigurationFile & | cf | ||
) | [friend] |
Definition at line 87 of file ConfigurationFile.cxx.
string ForIA::ConfigurationFile::myComment [protected] |
Definition at line 69 of file ConfigurationFile.hh.
std::map<string,string> ForIA::ConfigurationFile::myContents [protected] |
Definition at line 71 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::myDelimiter [protected] |
Definition at line 68 of file ConfigurationFile.hh.
string ForIA::ConfigurationFile::mySentry [protected] |
Definition at line 70 of file ConfigurationFile.hh.