----------------------------------------------------------------------------- Read all the option XMLs and Command Lines, and lock their values. -----------------------------------------------------------------------------
| 362 | // Read all the option XMLs and Command Lines, and lock their values. |
| 363 | //----------------------------------------------------------------------------- |
| 364 | bool Options::Lock |
| 365 | ( |
| 366 | ) |
| 367 | { |
| 368 | if( m_locked ) |
| 369 | { |
| 370 | Log::Write( LogLevel_Error, "Options are already final (locked)." ); |
| 371 | return false; |
| 372 | } |
| 373 | |
| 374 | ParseOptionsXML( m_SystemPath + m_xml ); |
| 375 | ParseOptionsXML( m_LocalPath + m_xml); |
| 376 | ParseOptionsString( m_commandLine ); |
| 377 | m_locked = true; |
| 378 | |
| 379 | /* Log our Configured Options */ |
| 380 | map<string,Option*>::iterator it; |
| 381 | Log::Write( LogLevel_Info, "Options:"); |
| 382 | for (it = m_options.begin(); it != m_options.end(); it++) { |
| 383 | Option *opt = it->second; |
| 384 | switch (opt->m_type) { |
| 385 | case OptionType_Bool: |
| 386 | Log::Write( LogLevel_Info, "\t%s: %s", it->first.c_str(), opt->m_valueBool == true ? "true" : "false"); |
| 387 | break; |
| 388 | case OptionType_Int: |
| 389 | Log::Write( LogLevel_Info, "\t%s: %d", it->first.c_str(), opt->m_valueInt); |
| 390 | break; |
| 391 | case OptionType_String: |
| 392 | Log::Write( LogLevel_Info, "\t%s: %s", it->first.c_str(), opt->m_valueString.c_str()); |
| 393 | break; |
| 394 | case OptionType_Invalid: |
| 395 | Log::Write( LogLevel_Info, "\t%s: Invalid Type"); |
| 396 | break; |
| 397 | } |
| 398 | } |
| 399 | return true; |
| 400 | } |
| 401 | |
| 402 | //----------------------------------------------------------------------------- |
| 403 | // <Options::ParseOptionsString> |
no test coverage detected