| 1232 | bool ConfigStoreImpl::log_changes = CONFIG_LOG_CHANGES_default; |
| 1233 | |
| 1234 | void |
| 1235 | process_section(ConfigStoreImpl& config_store, |
| 1236 | ConfigReader_rch reader, |
| 1237 | ConfigReaderListener_rch listener, |
| 1238 | const String& key_prefix, |
| 1239 | ACE_Configuration_Heap& config, |
| 1240 | const ACE_Configuration_Section_Key& base, |
| 1241 | bool allow_overwrite) |
| 1242 | { |
| 1243 | // Process the values. |
| 1244 | int status = 0; |
| 1245 | for (int idx = 0; status == 0; ++idx) { |
| 1246 | ACE_TString key; |
| 1247 | ACE_Configuration_Heap::VALUETYPE value_type; |
| 1248 | status = config.enumerate_values(base, idx, key, value_type); |
| 1249 | if (status == 0) { |
| 1250 | switch (value_type) { |
| 1251 | case ACE_Configuration_Heap::STRING: |
| 1252 | { |
| 1253 | ACE_TString value; |
| 1254 | if (config.get_string_value(base, key.c_str(), value) == 0) { |
| 1255 | const String key_name = key_prefix + "_" + ACE_TEXT_ALWAYS_CHAR(key.c_str()); |
| 1256 | String value_str = ACE_TEXT_ALWAYS_CHAR(value.c_str()); |
| 1257 | if (allow_overwrite || !config_store.has(key_name.c_str())) { |
| 1258 | config_store.set(key_name.c_str(), value_str); |
| 1259 | if (listener && reader) { |
| 1260 | listener->on_data_available(reader); |
| 1261 | } |
| 1262 | } else if (log_level >= LogLevel::Notice) { |
| 1263 | ACE_DEBUG((LM_NOTICE, |
| 1264 | "(%P|%t) NOTICE: process_section: " |
| 1265 | "value from commandline or user for %s overrides value in config file\n", |
| 1266 | key.c_str())); |
| 1267 | } |
| 1268 | } else { |
| 1269 | if (log_level >= LogLevel::Error) { |
| 1270 | ACE_ERROR((LM_ERROR, |
| 1271 | "(%P|%t) ERROR: process_section: " |
| 1272 | "get_string_value() failed for key \"%s\"\n", |
| 1273 | key.c_str())); |
| 1274 | } |
| 1275 | } |
| 1276 | } |
| 1277 | break; |
| 1278 | case ACE_Configuration_Heap::INTEGER: |
| 1279 | case ACE_Configuration_Heap::BINARY: |
| 1280 | case ACE_Configuration_Heap::INVALID: |
| 1281 | if (log_level >= LogLevel::Error) { |
| 1282 | ACE_ERROR((LM_ERROR, |
| 1283 | "(%P|%t) ERROR: process_section: " |
| 1284 | "unsupported value type for key \"%s\"\n", |
| 1285 | key.c_str())); |
| 1286 | } |
| 1287 | break; |
| 1288 | } |
| 1289 | } |
| 1290 | } |
| 1291 |
no test coverage detected