2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#ifndef UTILS_CONFIGAPP_H
43#define UTILS_CONFIGAPP_H
45#ifndef DOXYGEN_SHOULD_SKIP_THIS
58#pragma GCC diagnostic push
59#pragma GCC diagnostic ignored "-Wfloat-equal"
61#if __has_warning
("-Wweak-vtables")
62#pragma GCC diagnostic ignored "-Wweak-vtables"
64#if __has_warning
("-Wcovered-switch-default")
65#pragma GCC diagnostic ignored "-Wcovered-switch-default"
67#if __has_warning
("-Wmissing-noreturn")
68#pragma GCC diagnostic ignored "-Wmissing-noreturn"
70#if __has_warning
("-Wnrvo")
71#pragma GCC diagnostic ignored "-Wnrvo"
75#include "utils/CLI11.hpp"
77#pragma GCC diagnostic pop
86 AppWithPtr(
const std::string& description,
const std::string& name, T* t);
98 :
CLI::App(description, name)
CLI::Option * htmlRootOpt
ConfigWWW & setHtmlRoot(const std::string &htmlRoot)
std::string getHtmlRoot()
static constexpr std::string_view name
static constexpr std::string_view description
CLI::App * newSection(std::shared_ptr< CLI::App > appWithPtr, const std::string &group)
const std::string & getInstanceName() const
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName)
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
CLI::Option * addOptionFunction(const std::string &name, const std::function< void(const std::string &)> &optionFunction, const std::string &description)
ConfigSection(ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")
CLI::Option * addFlag(const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
CLI::Option * addFlag(const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
ConfigInstance * instance
CLI::Option * addFlag(const std::string &name, const std::string &description, const std::string &typeName)
void required(CLI::Option *opt, bool req=true)
ConfigWWW(net::config::ConfigInstance *instance)
static constexpr std::string_view description
ConfigWWW & setHtmlRoot(const std::string &htmlRoot)
std::string getHtmlRoot()
static constexpr std::string_view name
CLI::Option * htmlRootOpt
static CLI::Option * enforceLogFileOpt
static CLI::Option * verboseLevelOpt
static CLI::Option * groupNameOpt
static bool removeInstance(CLI::App *instance)
static std::string applicationName
Config(const Config &)=delete
static std::map< std::string, std::string > aliases
static CLI::App * addHelp(CLI::App *app)
static CLI::App * helpTriggerApp
static std::shared_ptr< CLI::Formatter > sectionFormatter
static CLI::Option * logFileOpt
static std::string configDirectory
static std::shared_ptr< CLI::App > app
static std::string pidDirectory
static CLI::App * addSimpleHelp(CLI::App *app)
static std::string getApplicationName()
static CLI::App * showConfigTriggerApp
static void disabled(CLI::App *instance, bool disabled=true)
static std::vector< std::shared_ptr< void > > configSections
static CLI::App * addStandardFlags(CLI::App *app)
static CLI::Option * userNameOpt
static std::map< std::string, CLI::Option * > applicationOptions
static std::string logDirectory
static bool init(int argc, char *argv[])
static void required(CLI::App *instance, bool required=true)
Config & operator=(const Config &)=delete
static CLI::Option * quietOpt
static CLI::Option * daemonizeOpt
static CLI::Option * logLevelOpt
static CLI::App * newInstance(std::shared_ptr< CLI::App > appWithPtr, const std::string &group, bool final=false)
static int getVerboseLevel()
std::shared_ptr< CLI::App > Section(const std::string &name, const std::string &description, T *section)
std::shared_ptr< CLI::App > Section(T *section)
std::shared_ptr< utils::AppWithPtr< T > > Instance(const std::string &name, const std::string &description, T *section)
AppWithPtr(const std::string &description, const std::string &name, T *t)