SNode.C
Loading...
Searching...
No Matches
instance::ConfigWWW Class Reference

#include <ConfigWWW.h>

Collaboration diagram for instance::ConfigWWW:

Public Member Functions

 ConfigWWW ()
ConfigWWWsetHtmlRoot (const std::string &htmlRoot)
std::string getHtmlRoot ()

Static Public Attributes

static constexpr std::string_view name {"www"}
static constexpr std::string_view description {"Web behavior of httpserver"}

Private Attributes

CLI::App * configWWWSc
CLI::Option * htmlRootOpt

Detailed Description

Definition at line 77 of file ConfigWWW.h.

Constructor & Destructor Documentation

◆ ConfigWWW()

instance::ConfigWWW::ConfigWWW ( )

Definition at line 73 of file ConfigWWW.cpp.

75 utils::Config::newInstance(net::config::Instance(std::string(name), std::string(description), this), "Applications", true)) {
76 htmlRootOpt = configWWWSc->add_option("--html-root", "HTML root directory")
77 ->group(configWWWSc->get_formatter()->get_label("Persistent Options"))
78 ->type_name("path")
79 ->configurable()
80 ->required();
81
82 configWWWSc->required()->needs(htmlRootOpt);
83 configWWWSc->get_parent()->needs(configWWWSc);
84 }
CLI::Option * htmlRootOpt
Definition ConfigWWW.h:89
static constexpr std::string_view name
Definition ConfigWWW.h:79
static constexpr std::string_view description
Definition ConfigWWW.h:80
CLI::App * configWWWSc
Definition ConfigWWW.h:88
static CLI::App * newInstance(std::shared_ptr< CLI::App > appWithPtr, const std::string &group, bool final=false)
Definition Config.cpp:736
std::shared_ptr< utils::AppWithPtr< T > > Instance(const std::string &name, const std::string &description, T *section)

References configWWWSc, description, htmlRootOpt, net::config::Instance(), name, and utils::Config::newInstance().

Here is the call graph for this function:

Member Function Documentation

◆ getHtmlRoot()

std::string instance::ConfigWWW::getHtmlRoot ( )

Definition at line 96 of file ConfigWWW.cpp.

96 {
97 return htmlRootOpt->as<std::string>();
98 }

References htmlRootOpt.

Referenced by main().

Here is the caller graph for this function:

◆ setHtmlRoot()

ConfigWWW & instance::ConfigWWW::setHtmlRoot ( const std::string & htmlRoot)

Definition at line 86 of file ConfigWWW.cpp.

86 {
87 htmlRootOpt->default_str(htmlRoot)->clear();
88 htmlRootOpt->required(false);
89
90 configWWWSc->required(false)->remove_needs(htmlRootOpt);
91 configWWWSc->get_parent()->remove_needs(configWWWSc);
92
93 return *this;
94 }

References configWWWSc, and htmlRootOpt.

Member Data Documentation

◆ configWWWSc

CLI::App* instance::ConfigWWW::configWWWSc
private

Definition at line 88 of file ConfigWWW.h.

Referenced by ConfigWWW(), and setHtmlRoot().

◆ description

std::string_view instance::ConfigWWW::description {"Web behavior of httpserver"}
staticconstexpr

Definition at line 80 of file ConfigWWW.h.

80{"Web behavior of httpserver"};

Referenced by ConfigWWW().

◆ htmlRootOpt

CLI::Option* instance::ConfigWWW::htmlRootOpt
private

Definition at line 89 of file ConfigWWW.h.

Referenced by ConfigWWW(), getHtmlRoot(), and setHtmlRoot().

◆ name

std::string_view instance::ConfigWWW::name {"www"}
staticconstexpr

Definition at line 79 of file ConfigWWW.h.

79{"www"};

Referenced by ConfigWWW().


The documentation for this class was generated from the following files: