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

#include <ConfigWWW.h>

Inheritance diagram for section::ConfigWWW:
Collaboration diagram for section::ConfigWWW:

Public Member Functions

 ConfigWWW (net::config::ConfigInstance *instance)
ConfigWWWsetHtmlRoot (const std::string &htmlRoot)
std::string getHtmlRoot ()
Public Member Functions inherited from net::config::ConfigSection
template<typename T>
 ConfigSection (ConfigInstance *instance, T *sectionPtr, const std::string &group="Sections")
virtual ~ConfigSection ()
 ConfigSection (const ConfigSection &)=delete
 ConfigSection (ConfigSection &&)=delete
ConfigSectionoperator= (const ConfigSection &)=delete
ConfigSectionoperator= (ConfigSection &&)=delete
CLI::Option * addOption (const std::string &name, const std::string &description)
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, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &optionFunction, const std::string &description)
CLI::Option * addFlag (const std::string &name, const std::string &description)
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName)
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator)
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue)
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator)
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue)
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const std::string &defaultValue, const CLI::Validator &validator)
CLI::Option * getOption (const std::string &name) const
void required (CLI::Option *opt, bool req=true)
void required (bool required=true)
bool getRequired () const
template<typename ValueType>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue)
template<typename ValueType>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator)
template<typename ValueType>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue)
template<typename ValueType>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueType defaultValue, const CLI::Validator &additionalValidator)

Static Public Attributes

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

Private Attributes

CLI::Option * htmlRootOpt

Additional Inherited Members

Protected Member Functions inherited from net::config::ConfigSection
void setConfigurable (CLI::Option *option, bool configurable)
Protected Attributes inherited from net::config::ConfigSection
CLI::App * sectionSc = nullptr

Detailed Description

Definition at line 59 of file ConfigWWW.h.

Constructor & Destructor Documentation

◆ ConfigWWW()

section::ConfigWWW::ConfigWWW ( net::config::ConfigInstance * instance)

Definition at line 52 of file ConfigWWW.cpp.

53 : net::config::ConfigSection(instance, this) {
54 htmlRootOpt = addOption("--html-root", "HTML root directory", "path", "");
56 }
CLI::Option * addOption(const std::string &name, const std::string &description)
void required(CLI::Option *opt, bool req=true)
CLI::Option * htmlRootOpt
Definition ConfigWWW.h:70

References net::config::ConfigSection::addOption(), net::config::ConfigSection::ConfigSection(), htmlRootOpt, and net::config::ConfigSection::required().

Here is the call graph for this function:

Member Function Documentation

◆ getHtmlRoot()

std::string section::ConfigWWW::getHtmlRoot ( )

Definition at line 65 of file ConfigWWW.cpp.

65 {
66 return htmlRootOpt->as<std::string>();
67 }

References htmlRootOpt.

◆ setHtmlRoot()

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

Definition at line 58 of file ConfigWWW.cpp.

58 {
59 htmlRootOpt->default_str(htmlRoot)->clear();
60 required(htmlRootOpt, false);
61
62 return *this;
63 }

References htmlRootOpt, and net::config::ConfigSection::required().

Here is the call graph for this function:

Member Data Documentation

◆ description

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

Definition at line 62 of file ConfigWWW.h.

62{"Web behavior of httpserver"};

◆ htmlRootOpt

CLI::Option* section::ConfigWWW::htmlRootOpt
private

Definition at line 70 of file ConfigWWW.h.

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

◆ name

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

Definition at line 61 of file ConfigWWW.h.

61{"www"};

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