bes
Updated for version 3.20.6
|
34 #define TheBESKeys_h_ 1
85 std::ifstream * _keys_file;
86 std::string _keys_file_name;
87 std::map<std::string, std::vector<std::string> > *_the_keys;
90 static std::set<std::string> KeyList;
91 static bool LoadedKeys(
const std::string &key_file);
94 void initialize_keys();
103 _keys_file(0), _keys_file_name(
""), _the_keys(0), _own_keys(
false)
107 TheBESKeys(
const std::string &keys_file_name, std::map<std::string, std::vector<std::string> > *keys);
110 TheBESKeys(
const std::string &keys_file_name);
116 std::string keys_file_name()
const
118 return _keys_file_name;
121 void set_key(
const std::string &key,
const std::string &val,
bool addto =
false);
122 void set_key(
const std::string &pair);
124 void get_value(
const std::string& s, std::string &val,
bool &found);
125 void get_values(
const std::string& s, std::vector<std::string> &vals,
bool &found);
127 bool read_bool_key(
const std::string &key,
bool default_value);
128 std::string
read_string_key(
const std::string &key,
const std::string &default_value);
129 int read_int_key(
const std::string &key,
int default_value);
131 typedef std::map<std::string, std::vector<std::string> >::const_iterator Keys_citer;
133 Keys_citer keys_begin()
135 return _the_keys->begin();
138 Keys_citer keys_end()
140 return _the_keys->end();
143 virtual void dump(std::ostream &strm)
const;
157 #endif // TheBESKeys_h_
static std::string ConfigFile
std::string read_string_key(const std::string &key, const std::string &default_value)
Read a string-valued key from the bes.conf file.
bool read_bool_key(const std::string &key, bool default_value)
Read a boolean-valued key from the bes.conf file.
static TheBESKeys * TheKeys()
mapping of key/value pairs defining different behaviors of an application.
top level BES object to house generic methods
void get_value(const std::string &s, std::string &val, bool &found)
Retrieve the value of a given key, if set.
void get_values(const std::string &s, std::vector< std::string > &vals, bool &found)
Retrieve the values of a given key, if set.
void set_key(const std::string &key, const std::string &val, bool addto=false)
allows the user to set key/value pairs from within the application.
virtual ~TheBESKeys()
cleans up the key/value pair mapping
virtual void dump(std::ostream &strm) const
dumps information about this object
int read_int_key(const std::string &key, int default_value)
Read an integer-valued key from the bes.conf file.