#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 41 of file ConfigInstance.h.
◆ Instance
◆ Role
◆ ConfigInstance() [1/3]
net::config::ConfigInstance::ConfigInstance |
( |
const std::string & | instanceName, |
|
|
Role | role ) |
|
explicitprotected |
Definition at line 52 of file ConfigInstance.cpp.
56 std::string("Configuration for ")
58 .append(" instance '")
60 .append("'"),
61 "Instance");
62
65
67 ->add_flag_callback(
68 "--disabled{true}",
69 [this]() {
71 },
72 "Disable this instance")
73 ->trigger_on_parse()
74 ->default_val("false")
75 ->type_name("bool")
76 ->check(CLI::IsMember({"true", "false"}))
77 ->group(
instanceSc->get_formatter()->get_label(
"Persistent Options"));
78 }
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 80 of file ConfigInstance.cpp.
80 {
82 }
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 96 of file ConfigInstance.cpp.
96 {
98 ->add_subcommand(name, description)
99 ->fallthrough()
100 ->configurable(false)
101 ->allow_extras(false)
102 ->group("Sections")
104
105 sectionSc
106 ->option_defaults()
107 ->configurable(!sectionSc->get_disabled());
108
109 if (!sectionSc->get_disabled()) {
112 }
113
114 return sectionSc;
115 }
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 117 of file ConfigInstance.cpp.
117 {
118 if (req != section->get_required()) {
119 if (req) {
122 } else {
125 }
126
127 section->required(req);
128
131 }
132 }
133 }
static void required(CLI::App *instance, bool reqired=true)
◆ setDisabled()
void net::config::ConfigInstance::setDisabled |
( |
bool | disabled = true | ) |
|
Definition at line 148 of file ConfigInstance.cpp.
148 {
150 ->default_val(disabled ? "true" : "false")
151 ->clear();
152
154 }
◆ 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: