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

#include <ConfigHTTP.h>

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

Public Member Functions

 ConfigHTTP (net::config::ConfigInstance &configInstance)
 
 ConfigHTTP (ConfigHTTP &)=delete
 
ConfigHTTPoperator= (ConfigHTTP &)=delete
 
 ConfigHTTP (ConfigHTTP &&) noexcept=default
 
ConfigHTTPoperator= (ConfigHTTP &&)=delete
 
void setHostHeader (const std::string &hostHeader)
 
std::string getHostHeader () const
 
void setPipelinedRequests (bool pipelinedRequests)
 
bool getPipelinedRequests () const
 

Private Attributes

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

Detailed Description

Definition at line 61 of file ConfigHTTP.h.

Constructor & Destructor Documentation

◆ ConfigHTTP() [1/3]

web::http::client::ConfigHTTP::ConfigHTTP ( net::config::ConfigInstance configInstance)
explicit

Definition at line 55 of file ConfigHTTP.cpp.

55 {
56 hostHeaderOpt = net::config::ConfigSection(&configInstance, "http", "HTTP behavior")
57 .addOption( //
58 "--host",
59 "HTTP request 'Host' header field",
60 "string");
61
62 pipelinedRequestsOpt = net::config::ConfigSection(&configInstance, "http", "HTTP behavior")
63 .addFlag( //
64 "--pipelined-requests",
65 "Pipelined requests",
66 "bool",
67 XSTR(HTTP_REQUEST_PIPELINED),
68 CLI::IsMember({"true", "false"}));
69 }
#define XSTR(s)
CLI::Option * addOption(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 * pipelinedRequestsOpt
Definition ConfigHTTP.h:78

References net::config::ConfigSection::addFlag(), net::config::ConfigSection::addOption(), net::config::ConfigSection::ConfigSection(), hostHeaderOpt, and pipelinedRequestsOpt.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigHTTP() [2/3]

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

◆ ConfigHTTP() [3/3]

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

Member Function Documentation

◆ getHostHeader()

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

Definition at line 75 of file ConfigHTTP.cpp.

75 {
76 return hostHeaderOpt->as<std::string>();
77 }

References hostHeaderOpt.

Referenced by web::http::client::SocketContextFactory::create(), and web::http::client::SocketContextFactory::getHostHeader().

Here is the caller graph for this function:

◆ getPipelinedRequests()

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

Definition at line 83 of file ConfigHTTP.cpp.

83 {
84 return pipelinedRequestsOpt->as<bool>();
85 }

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()

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

Definition at line 71 of file ConfigHTTP.cpp.

71 {
72 hostHeaderOpt->default_str(hostHeader);
73 }

References hostHeaderOpt.

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

Here is the caller graph for this function:

◆ setPipelinedRequests()

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

Definition at line 79 of file ConfigHTTP.cpp.

79 {
80 pipelinedRequestsOpt->default_val(pipelinedRequests ? "true" : "false");
81 }

References pipelinedRequestsOpt.

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

Here is the caller graph for this function:

Member Data Documentation

◆ hostHeaderOpt

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

Definition at line 77 of file ConfigHTTP.h.

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

◆ 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: