34 #define TheBESKeys_h_ 1 87 ifstream * _keys_file;
88 std::string _keys_file_name;
89 std::map<std::string, std::vector<string> > *_the_keys;
92 static std::vector<std::string> KeyList;
93 static bool LoadedKeys(
const std::string &key_file);
96 void initialize_keys();
98 bool break_pair(
const char* b,
string& key,
string &value,
bool &addto);
99 bool only_blanks(
const char *line);
100 void load_include_files(
const string &files);
101 void load_include_file(
const string &file);
104 _keys_file(0), _keys_file_name(
""), _the_keys(0), _own_keys(
false)
108 TheBESKeys(
const string &keys_file_name, map<
string, vector<string> > *keys);
117 std::string keys_file_name()
const 119 return _keys_file_name;
122 void set_key(
const string &key,
const string &val,
bool addto =
false);
123 void set_key(
const string &pair);
124 void get_value(
const string& s,
string &val,
bool &found);
125 void get_values(
const string& s, vector<string> &vals,
bool &found);
127 typedef map<string, vector<string> >::const_iterator Keys_citer;
129 Keys_citer keys_begin()
131 return _the_keys->begin();
134 Keys_citer keys_end()
136 return _the_keys->end();
139 virtual void dump(ostream &strm)
const;
153 #endif // TheBESKeys_h_ mapping of key/value pairs defining different behaviors of an application.
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
void set_key(const string &key, const string &val, bool addto=false)
allows the user to set key/value pairs from within the application.
Base object for bes objects.
static TheBESKeys * TheKeys()
virtual ~TheBESKeys()
cleans up the key/value pair mapping
void get_values(const string &s, vector< string > &vals, bool &found)
Retrieve the values of a given key, if set.
virtual void dump(ostream &strm) const
dumps information about this object