MCPcopy Create free account
hub / github.com/ByConity/ByConity / addProgramOptions

Method addProgramOptions

src/Core/Settings.cpp:104–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void 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
120void Settings::checkNoSettingNamesAtTopLevel(const Poco::Util::AbstractConfiguration & config, const String & config_path)
121{

Callers 3

initMethod · 0.80
initMethod · 0.80

Calls 5

setFunction · 0.50
getNameMethod · 0.45
addMethod · 0.45
dataMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected