MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / ParseConfig

Function ParseConfig

libi2pd/Config.cpp:468–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

initMethod · 0.85

Calls 1

ThrowFatalFunction · 0.85

Tested by

no test coverage detected