| 466 | } |
| 467 | |
| 468 | void ParseConfig(const std::string& path) |
| 469 | { |
| 470 | if (path == "") return; |
| 471 | |
| 472 | std::ifstream config(path, std::ios::in); |
| 473 | |
| 474 | if (!config.is_open()) |
| 475 | { |
| 476 | ThrowFatal ("Missing or unreadable config file: ", path); |
| 477 | std::cerr << "missing/unreadable config file: " << path << std::endl; |
| 478 | exit(EXIT_FAILURE); |
| 479 | } |
| 480 | |
| 481 | try |
| 482 | { |
| 483 | store(boost::program_options::parse_config_file(config, m_OptionsDesc), m_Options); |
| 484 | } |
| 485 | catch (boost::program_options::error& e) |
| 486 | { |
| 487 | ThrowFatal ("Error while parsing config file: ", e.what()); |
| 488 | std::cerr << e.what() << std::endl; |
| 489 | exit(EXIT_FAILURE); |
| 490 | }; |
| 491 | } |
| 492 | |
| 493 | void Finalize() |
| 494 | { |