SNode.C
Loading...
Searching...
No Matches
web::http::client::ConfigHTTP Class Reference

#include <ConfigHTTP.h>

Inheritance diagram for web::http::client::ConfigHTTP:
Collaboration diagram for web::http::client::ConfigHTTP:

Public Member Functions

 ConfigHTTP (utils::SubCommand *parent)
 ~ConfigHTTP () override
 ConfigHTTP (ConfigHTTP &)=delete
ConfigHTTPoperator= (ConfigHTTP &)=delete
 ConfigHTTP (ConfigHTTP &&) noexcept=delete
ConfigHTTPoperator= (ConfigHTTP &&)=delete
ConfigHTTPsetHostHeader (const std::string &hostHeader)
std::string getHostHeader () const
ConfigHTTPsetPipelinedRequests (bool pipelinedRequests)
bool getPipelinedRequests () const
Public Member Functions inherited from utils::SubCommand
 SubCommand (const SubCommand &)=delete
 SubCommand (SubCommand &&)=delete
SubCommandoperator= (const SubCommand &)=delete
SubCommandoperator= (SubCommand &&)=delete
virtual ~SubCommand ()
std::string getName () const
std::string version () const
CLI::Option * setConfig (const std::string &defaultConfigFile) const
CLI::Option * setLogFile (const std::string &defaultLogFile) const
CLI::Option * setVersionFlag (const std::string &version) const
bool hasParent () const
SubCommandgetParent () const
SubCommandallowExtras (bool allow=true)
SubCommandrequired (bool required=true, bool force=true)
SubCommandrequired (SubCommand *subCommand, bool required=true)
SubCommandrequired (CLI::Option *option, bool required=true)
bool getRequired () const
SubCommandneeds (SubCommand *subCommand, bool needs=true)
SubCommanddisabled (SubCommand *subCommand, bool disabled=true)
SubCommandsetRequireCallback (const std::function< void(void)> &callback)
SubCommandfinalCallback (const std::function< void()> &finalCallback)
std::string configToStr () const
std::string help (const CLI::App *helpApp, const CLI::AppFormatMode &mode) const
template<typename NewSubCommand, typename... Args>
NewSubCommand * newSubCommand (Args &&... args)
template<typename RequestedSubCommand>
RequestedSubCommand * getSubCommand ()
template<typename RequestedSubCommand>
RequestedSubCommand * getSubCommand () const
CLI::Option * getOption (const std::string &name) const
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOption (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOptionVariable (const std::string &name, ValueTypeT &variable, const std::string &description, const std::string &typeName, const CLI::Validator &additionalValidator) const
template<typename ValueTypeT>
CLI::Option * addOptionVariable (const std::string &name, ValueTypeT &variable, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &additionalValidator) const
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &callback, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addOptionFunction (const std::string &name, const std::function< void(const std::string &)> &callback, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
template<typename ValueTypeT>
CLI::Option * addFlag (const std::string &name, const std::string &description, const std::string &typeName, ValueTypeT defaultValue, const CLI::Validator &validator) const
CLI::Option * addFlagFunction (const std::string &name, const std::function< void()> &callback, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
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) const

Static Public Attributes

static constexpr std::string_view NAME {"http"}
static constexpr std::string_view DESCRIPTION {"HTTP behavior"}

Private Attributes

CLI::Option * hostHeaderOpt = nullptr
CLI::Option * pipelinedRequestsOpt = nullptr

Additional Inherited Members

Protected Member Functions inherited from utils::SubCommand
 SubCommand (SubCommand *parent, std::shared_ptr< utils::AppWithPtr > appWithPtr, const std::string &group, bool final)
template<typename ConcretSubCommand>
 SubCommand (SubCommand *parent, ConcretSubCommand *concretSubCommand, const std::string &group, bool final=true)
void parse (int argc, char *argv[]) const
SubCommanddescription (const std::string &description)
SubCommandfooter (const std::string &footer)
void removeSubCommand ()
template<typename ValueTypeT>
CLI::Option * setDefaultValue (CLI::Option *option, const ValueTypeT &value, bool clear=true) const
CLI::Option * setConfigurable (CLI::Option *option, bool configurable) const
Static Protected Member Functions inherited from utils::SubCommand
static CLI::App * getHelpTriggerApp ()
static CLI::App * getShowConfigTriggerApp ()
static CLI::App * getCommandlineTriggerApp ()
Static Protected Attributes inherited from utils::SubCommand
static std::shared_ptr< CLI::Formatter > sectionFormatter = makeSectionFormatter()
static std::map< std::string, std::string > aliases
static CLI::App * helpTriggerApp = nullptr
static CLI::App * showConfigTriggerApp = nullptr
static CLI::App * commandlineTriggerApp = nullptr

Detailed Description

Definition at line 55 of file ConfigHTTP.h.

Constructor & Destructor Documentation

◆ ConfigHTTP() [1/3]

web::http::client::ConfigHTTP::ConfigHTTP ( utils::SubCommand * parent)
explicit

Definition at line 53 of file ConfigHTTP.cpp.

54 : utils::SubCommand(parent, this, "Applications") {
56 "--host",
57 "HTTP request 'Host' header field",
58 "hostname|IP",
59 CLI::TypeValidator<std::string>());
60
62 "--pipelined-requests{true}",
63 "Pipelined requests",
64 "bool",
65 XSTR(HTTP_REQUEST_PIPELINED),
66 CLI::IsMember({"true", "false"}));
67 }
#define XSTR(s)
SubCommand * parent
Definition SubCommand.h:251
CLI::Option * addOption(const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
CLI::Option * addFlag(const std::string &name, const std::string &description, const std::string &typeName, const CLI::Validator &validator) const
CLI::Option * pipelinedRequestsOpt
Definition ConfigHTTP.h:78

References utils::SubCommand::addFlag(), utils::SubCommand::addOption(), hostHeaderOpt, pipelinedRequestsOpt, and utils::SubCommand::SubCommand().

Here is the call graph for this function:

◆ ~ConfigHTTP()

web::http::client::ConfigHTTP::~ConfigHTTP ( )
override

Definition at line 69 of file ConfigHTTP.cpp.

69 {
70 }

◆ ConfigHTTP() [2/3]

web::http::client::ConfigHTTP::ConfigHTTP ( ConfigHTTP & )
delete

◆ ConfigHTTP() [3/3]

web::http::client::ConfigHTTP::ConfigHTTP ( ConfigHTTP && )
deletenoexcept

Member Function Documentation

◆ getHostHeader()

std::string web::http::client::ConfigHTTP::getHostHeader ( ) const

Definition at line 78 of file ConfigHTTP.cpp.

78 {
79 return hostHeaderOpt->as<std::string>();
80 }

References hostHeaderOpt.

Referenced by web::http::client::SocketContextFactory::create().

Here is the caller graph for this function:

◆ getPipelinedRequests()

bool web::http::client::ConfigHTTP::getPipelinedRequests ( ) const

Definition at line 88 of file ConfigHTTP.cpp.

88 {
89 return pipelinedRequestsOpt->as<bool>();
90 }

References pipelinedRequestsOpt.

Referenced by web::http::client::SocketContextFactory::create().

Here is the caller graph for this function:

◆ operator=() [1/2]

ConfigHTTP & web::http::client::ConfigHTTP::operator= ( ConfigHTTP && )
delete

◆ operator=() [2/2]

ConfigHTTP & web::http::client::ConfigHTTP::operator= ( ConfigHTTP & )
delete

◆ setHostHeader()

ConfigHTTP & web::http::client::ConfigHTTP::setHostHeader ( const std::string & hostHeader)

Definition at line 72 of file ConfigHTTP.cpp.

72 {
73 setDefaultValue(hostHeaderOpt, hostHeader);
74
75 return *this;
76 }
CLI::Option * setDefaultValue(CLI::Option *option, const ValueTypeT &value, bool clear=true) const
Definition SubCommand.h:347

References hostHeaderOpt, and utils::SubCommand::setDefaultValue().

Here is the call graph for this function:

◆ setPipelinedRequests()

ConfigHTTP & web::http::client::ConfigHTTP::setPipelinedRequests ( bool pipelinedRequests)

Definition at line 82 of file ConfigHTTP.cpp.

82 {
83 setDefaultValue(pipelinedRequestsOpt, pipelinedRequests ? "true" : "false");
84
85 return *this;
86 }

References pipelinedRequestsOpt, and utils::SubCommand::setDefaultValue().

Here is the call graph for this function:

Member Data Documentation

◆ DESCRIPTION

std::string_view web::http::client::ConfigHTTP::DESCRIPTION {"HTTP behavior"}
staticconstexpr

Definition at line 58 of file ConfigHTTP.h.

58{"HTTP behavior"};

◆ hostHeaderOpt

CLI::Option* web::http::client::ConfigHTTP::hostHeaderOpt = nullptr
private

Definition at line 77 of file ConfigHTTP.h.

Referenced by ConfigHTTP(), getHostHeader(), and setHostHeader().

◆ NAME

std::string_view web::http::client::ConfigHTTP::NAME {"http"}
staticconstexpr

Definition at line 57 of file ConfigHTTP.h.

57{"http"};

◆ pipelinedRequestsOpt

CLI::Option* web::http::client::ConfigHTTP::pipelinedRequestsOpt = nullptr
private

Definition at line 78 of file ConfigHTTP.h.

Referenced by ConfigHTTP(), getPipelinedRequests(), and setPipelinedRequests().


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