| 102 | } |
| 103 | |
| 104 | void Settings::addProgramOptions(boost::program_options::options_description & options) |
| 105 | { |
| 106 | for (const auto & field : all()) |
| 107 | { |
| 108 | const std::string_view name = field.getName(); |
| 109 | auto on_program_option |
| 110 | = boost::function1<void, const std::string &>([this, name](const std::string & value) { set(name, value); }); |
| 111 | // on_program_option is initialized with the lambda within boost:program_options |
| 112 | // coverity[uninit_use_in_call] |
| 113 | options.add(boost::shared_ptr<boost::program_options::option_description>(new boost::program_options::option_description( |
| 114 | name.data(), |
| 115 | boost::program_options::value<std::string>()->composing()->notifier(on_program_option), |
| 116 | field.getDescription()))); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void Settings::checkNoSettingNamesAtTopLevel(const Poco::Util::AbstractConfiguration & config, const String & config_path) |
| 121 | { |
no test coverage detected