34 #define TheBESKeys_h_ 1
84 std::ifstream * _keys_file;
85 std::string _keys_file_name;
86 std::map<std::string, std::vector<std::string> > *_the_keys;
89 static std::vector<std::string> KeyList;
90 static bool LoadedKeys(
const std::string &key_file);
93 void initialize_keys();
95 bool break_pair(
const char* b, std::string& key, std::string &value,
bool &addto);
96 bool only_blanks(
const char *line);
97 void load_include_files(
const std::string &files);
98 void load_include_file(
const std::string &file);
101 _keys_file(0), _keys_file_name(
""), _the_keys(0), _own_keys(
false)
105 TheBESKeys(
const std::string &keys_file_name, std::map<std::string, std::vector<std::string> > *keys);
108 TheBESKeys(
const std::string &keys_file_name);
114 std::string keys_file_name()
const
116 return _keys_file_name;
119 void set_key(
const std::string &key,
const std::string &val,
bool addto =
false);
120 void set_key(
const std::string &pair);
122 void get_value(
const std::string& s, std::string &val,
bool &found);
123 void get_values(
const std::string& s, std::vector<std::string> &vals,
bool &found);
125 bool read_bool_key(
const std::string &key,
bool default_value);
126 std::string
read_string_key(
const std::string &key,
const std::string &default_value);
127 int read_int_key(
const std::string &key,
int default_value);
129 typedef std::map<std::string, std::vector<std::string> >::const_iterator Keys_citer;
131 Keys_citer keys_begin()
133 return _the_keys->begin();
136 Keys_citer keys_end()
138 return _the_keys->end();
141 virtual void dump(std::ostream &strm)
const;
155 #endif // TheBESKeys_h_