#include <ConfigInstance.h>
|
CLI::App * | addSection (const std::string &name, const std::string &description) |
|
CLI::App * | getSection (const std::string &name) const |
|
void | required (CLI::App *section, bool req=true) |
|
bool | getRequired () const |
|
Definition at line 63 of file ConfigInstance.h.
◆ Instance
◆ Role
◆ ConfigInstance() [1/3]
net::config::ConfigInstance::ConfigInstance |
( |
const std::string & | instanceName, |
|
|
Role | role ) |
|
explicitprotected |
Definition at line 74 of file ConfigInstance.cpp.
78 std::string("Configuration for ")
80 .append(" instance '")
82 .append("'"),
83 "Instance");
84
87
89 ->add_flag_callback(
90 "--disabled{true}",
91 [this]() {
93 },
94 "Disable this instance")
95 ->trigger_on_parse()
96 ->default_val("false")
97 ->type_name("bool")
98 ->check(CLI::IsMember({"true", "false"}))
99 ->group(
instanceSc->get_formatter()->get_label(
"Persistent Options"));
100 }
static CLI::App * addStandardFlags(CLI::App *app)
static void disabled(CLI::App *instance, bool disabled=true)
static CLI::App * addHelp(CLI::App *app)
static CLI::App * addInstance(const std::string &name, const std::string &description, const std::string &group)
◆ ~ConfigInstance()
net::config::ConfigInstance::~ConfigInstance |
( |
| ) |
|
|
protectedvirtual |
Definition at line 102 of file ConfigInstance.cpp.
102 {
104 }
static bool removeInstance(CLI::App *instance)
◆ ConfigInstance() [2/3]
◆ ConfigInstance() [3/3]
◆ addSection()
CLI::App * net::config::ConfigInstance::addSection |
( |
const std::string & | name, |
|
|
const std::string & | description ) |
|
private |
Definition at line 118 of file ConfigInstance.cpp.
118 {
120 ->add_subcommand(name, description)
121 ->fallthrough()
122 ->configurable(false)
123 ->allow_extras(false)
124 ->group("Sections")
126
127 sectionSc
128 ->option_defaults()
129 ->configurable(!sectionSc->get_disabled());
130
131 if (!sectionSc->get_disabled()) {
134 }
135
136 return sectionSc;
137 }
static CLI::App * addSimpleHelp(CLI::App *app)
◆ getDisabled()
bool net::config::ConfigInstance::getDisabled |
( |
| ) |
const |
◆ getInstanceName()
const std::string & net::config::ConfigInstance::getInstanceName |
( |
| ) |
const |
◆ getRequired()
bool net::config::ConfigInstance::getRequired |
( |
| ) |
const |
|
private |
◆ getRole()
◆ getSection()
CLI::App * net::config::ConfigInstance::getSection |
( |
const std::string & | name | ) |
const |
|
private |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ required()
void net::config::ConfigInstance::required |
( |
CLI::App * | section, |
|
|
bool | req = true ) |
|
private |
Definition at line 139 of file ConfigInstance.cpp.
139 {
140 if (req != section->get_required()) {
141 if (req) {
144 } else {
147 }
148
149 section->required(req);
150
153 }
154 }
155 }
static void required(CLI::App *instance, bool reqired=true)
◆ setDisabled()
void net::config::ConfigInstance::setDisabled |
( |
bool | disabled = true | ) |
|
Definition at line 170 of file ConfigInstance.cpp.
170 {
172 ->default_val(disabled ? "true" : "false")
173 ->clear();
174
176 }
◆ setInstanceName()
void net::config::ConfigInstance::setInstanceName |
( |
const std::string & | instanceName | ) |
|
◆ net::config::ConfigSection
◆ disableOpt
CLI::Option* net::config::ConfigInstance::disableOpt = nullptr |
|
private |
◆ instanceName
std::string net::config::ConfigInstance::instanceName |
|
private |
◆ instanceSc
CLI::App* net::config::ConfigInstance::instanceSc = nullptr |
|
private |
◆ nameAnonymous
const std::string net::config::ConfigInstance::nameAnonymous = "<anonymous>" |
|
staticprivate |
◆ requiredCount
uint8_t net::config::ConfigInstance::requiredCount = 0 |
|
private |
◆ role
Role net::config::ConfigInstance::role |
|
private |
The documentation for this class was generated from the following files: