Lines Matching +refs:string +refs:ci

38 const string CONFIG_DEFAULT_FILE = "config.txt";
52 hash_map<string, Value*, hash<string> >::const_iterator ci; in ~Config() local
53 for( ci=_keyValueMap.begin(); ci!=_keyValueMap.end(); ci++) in ~Config()
55 delete ci->second; in ~Config()
59 for( ci=_keyValueMapTrans.begin(); ci!=_keyValueMapTrans.end(); ci++) in ~Config()
61 delete ci->second; in ~Config()
68 hash_map<string, Value*, hash<string> >::const_iterator ci; in getConfigItemList() local
69 for( ci=_keyValueMap.begin(); ci!=_keyValueMap.end(); ci++) in getConfigItemList()
72 item.key = ci->first; in getConfigItemList()
73 item.value = ci->second->getString(); in getConfigItemList()
78 const string &Config::getConfigFileName( void) in getConfigFileName()
80 static string configFile; in getConfigFileName()
103 string prefPath = getPreferencesPath(); in getConfigFileName()
106 _configDirectory = prefPath + string("/") + _configDirectory; in getConfigFileName()
107 configFile = prefPath + string("/") + configFile; in getConfigFileName()
124 string prefPath = getPreferencesPath(); in getConfigFileName()
127 string homeConfig = prefPath + string("/") + configFile; in getConfigFileName()
130 _configDirectory = prefPath + string("/") + _configDirectory; in getConfigFileName()
171 const string configFile = getConfigFileName(); in updateFromFile()
177 string systemConfigFile = "system/config.txt"; in updateFromFile()
188 string line; in updateFromFile()
205 string setKeyname = t.next(); in updateFromFile()
208 string keyword = t.next(); in updateFromFile()
209 string value = t.next(); in updateFromFile()
224 string tmpKeyword( keyword); in updateTransitoryKeyword()
225 string tmpValue( value); in updateTransitoryKeyword()
236 string tmpKeyword( keyword); in updateKeyword()
237 string tmpValue( value); in updateKeyword()
243 void Config::updateTransitoryKeyword( const string keyword, const string value) in updateTransitoryKeyword()
250 void Config::updateKeyword( const string keyword, const string value) in updateKeyword()
257 void Config::updateTransitoryKeyword( const string keyword, Value *value) in updateTransitoryKeyword()
264 void Config::updateKeyword( const string keyword, Value *value) in updateKeyword()
271 void Config::remove( const string &keyword) in remove()
276 void Config::removeTrans( const string &keyword) in removeTrans()
281 void Config::removeImpl( const string &keyword, in removeImpl()
282 hash_map< string, Value*, hash<string>, std::equal_to<string> > &kvmap) in removeImpl() argument
284 hash_map<string, Value*, hash<string> >::iterator ci; in removeImpl() argument
285 ci = kvmap.find( keyword); in removeImpl()
287 if( ci!=kvmap.end()) in removeImpl()
289 delete ci->second; in removeImpl()
290 kvmap.erase( ci); in removeImpl()
298 const string configFile = getConfigFileName(); in saveToFile()
301 string::size_type start = configFile.find_last_of( '/'); in saveToFile()
305 string path = configFile.substr( 0, start); in saveToFile()
327 hash_map<string, Value*, hash<string> >::const_iterator ci; in saveToFile() local
328 for( ci=_keyValueMap.begin(); ci!=_keyValueMap.end(); ci++) in saveToFile()
330 Value *val = ci->second; in saveToFile()
334 string v = val->getString(); in saveToFile()
335 if( v.find_first_of(" \t") != string::npos) in saveToFile()
338 outfile << "set " << ci->first << " = \"" << v << "\"" << endl; in saveToFile()
342 outfile << "set " << ci->first << " = " << v << endl; in saveToFile()
347 LOG_WARNING << "No value for key [" << ci->first << "]" << endl; in saveToFile()
360 bool Config::getString( const string &keyword, string &value) in getString()
367 bool Config::getInteger( const string &keyword, int &value) in getInteger()
374 bool Config::getBoolean( const string &keyword, bool &value) in getBoolean()
381 bool Config::getFloat( const string &keyword, float &value) in getFloat()
388 bool Config::getStringImpl( const string &keyword, string &value, in getStringImpl()
389 hash_map< string, Value*, hash<string>, std::equal_to<string> > &kvmap) in getStringImpl() argument
391 hash_map<string, Value*, hash<string> >::const_iterator ci; in getStringImpl() argument
392 ci = kvmap.find( keyword); in getStringImpl()
394 if( ci!=kvmap.end()) in getStringImpl()
396 value = ci->second->getString(); in getStringImpl()
403 bool Config::getIntegerImpl( const string &keyword, int &value, in getIntegerImpl()
404 hash_map< string, Value*, hash<string>, std::equal_to<string> > &kvmap) in getIntegerImpl() argument
406 hash_map<string, Value*, hash<string> >::const_iterator ci; in getIntegerImpl() argument
407 ci = kvmap.find( keyword); in getIntegerImpl()
409 if( ci!=kvmap.end()) in getIntegerImpl()
411 value = ci->second->getInteger(); in getIntegerImpl()
418 bool Config::getBooleanImpl( const string &keyword, bool &value, in getBooleanImpl()
419 hash_map< string, Value*, hash<string>, std::equal_to<string> > &kvmap) in getBooleanImpl() argument
421 hash_map<string, Value*, hash<string> >::const_iterator ci; in getBooleanImpl() argument
422 ci = kvmap.find( keyword); in getBooleanImpl()
424 if( ci!=kvmap.end()) in getBooleanImpl()
426 value = ci->second->getBoolean(); in getBooleanImpl()
433 bool Config::getFloatImpl( const string &keyword, float &value, in getFloatImpl()
434 hash_map< string, Value*, hash<string>, std::equal_to<string> > &kvmap) in getFloatImpl() argument
436 hash_map<string, Value*, hash<string> >::const_iterator ci; in getFloatImpl() argument
437 ci = kvmap.find( keyword); in getFloatImpl()
439 if( ci!=kvmap.end()) in getFloatImpl()
441 value = ci->second->getFloat(); in getFloatImpl()
451 hash_map<string, Value*, hash<string> >::const_iterator ci; in dump() local
453 for( ci=_keyValueMap.begin(); ci!=_keyValueMap.end(); ci++) in dump()
455 Value *val = ci->second; in dump()
457 LOG_INFO << ci->first << " = " << val->dump() << endl; in dump()
459 LOG_INFO << ci->first << endl; in dump()