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 126 of file StatusCodes.cpp.

126 {
127 return statusCode.contains(status);
128 }
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 116 of file StatusCodes.cpp.

116 {
117 std::string reasonPhrase = "unknown status code";
118
119 if (StatusCode::contains(status)) {
120 reasonPhrase = statusCode[status];
121 }
122
123 return reasonPhrase;
124 }
static bool contains(int status)

References contains(), and statusCode.

Referenced by web::http::server::Response::sendHeader(), express::Response::sendStatus(), and web::http::server::Response::sendStatus().

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: