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

#include <StatusCodes.h>

Collaboration diagram for web::http::StatusCode:

Static Public Member Functions

static std::string reason (int status)
 
static bool contains (int status)
 

Static Private Attributes

static std::map< int, std::string > statusCode
 

Detailed Description

Definition at line 53 of file StatusCodes.h.

Member Function Documentation

◆ contains()

bool web::http::StatusCode::contains ( int  status)
static

Definition at line 131 of file StatusCodes.cpp.

131 {
132 return statusCode.contains(status);
133 }
static std::map< int, std::string > statusCode
Definition StatusCodes.h:60

References statusCode.

Referenced by web::http::client::ResponseParser::parseStartLine(), and reason().

Here is the caller graph for this function:

◆ reason()

std::string web::http::StatusCode::reason ( int  status)
static

Definition at line 121 of file StatusCodes.cpp.

121 {
122 std::string reasonPhrase = "unknown status code";
123
124 if (StatusCode::contains(status)) {
125 reasonPhrase = statusCode[status];
126 }
127
128 return reasonPhrase;
129 }
static bool contains(int status)

References contains(), and statusCode.

Referenced by web::http::server::Request::Request(), web::http::server::SocketContext::requestCompleted(), web::http::server::SocketContext::responseCompleted(), web::http::server::SocketContext::responseStarted(), web::http::server::Response::sendHeader(), express::Response::sendStatus(), web::http::server::Response::sendStatus(), and web::http::server::Response::upgrade().

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

Member Data Documentation

◆ statusCode

std::map< int, std::string > web::http::StatusCode::statusCode
staticprivate

Definition at line 60 of file StatusCodes.h.

Referenced by contains(), and reason().


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