fhq-server  v0.2.33
Documentation for fhq-server. FreeHackQuest is an open source platform for competitions of computer security.
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
WsjcppLightWebHttpResponse Class Reference

#include <wsjcpp_light_web_http_response.h>

Public Member Functions

 WsjcppLightWebHttpResponse (int nSockFd)
 
WsjcppLightWebHttpResponseok ()
 
WsjcppLightWebHttpResponsebadRequest ()
 
WsjcppLightWebHttpResponseforbidden ()
 
WsjcppLightWebHttpResponsenotFound ()
 
WsjcppLightWebHttpResponsepayloadTooLarge ()
 
WsjcppLightWebHttpResponseinternalServerError ()
 
WsjcppLightWebHttpResponsenotImplemented ()
 
WsjcppLightWebHttpResponserequestTimeout ()
 
WsjcppLightWebHttpResponsenoCache ()
 
WsjcppLightWebHttpResponsecacheSec (int nCacheSec)
 
void sendText (const std::string &sBody)
 
void sendJson (const nlohmann::json &json)
 
void sendEmpty ()
 
void sendOptions (const std::string &sOptions)
 
void sendFile (const std::string &sFilePath)
 
void sendBuffer (const std::string &sFilePath, const char *pBuffer, const int nBufferSize)
 

Static Public Attributes

static std::map< int, std::string > * g_mapReponseDescription = nullptr
 

Private Member Functions

std::string prepareHeaders (int nLength)
 
std::string detectTypeOfFile (const std::string &sFilePath)
 

Private Attributes

std::string TAG
 
int m_nSockFd
 
bool m_bClosed
 
int m_nResponseCode
 
std::string m_sDataType
 
std::string m_sCacheControl
 
std::string m_sLastModified
 

Constructor & Destructor Documentation

◆ WsjcppLightWebHttpResponse()

WsjcppLightWebHttpResponse::WsjcppLightWebHttpResponse ( int  nSockFd)

Member Function Documentation

◆ badRequest()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::badRequest ( )

◆ cacheSec()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::cacheSec ( int  nCacheSec)

◆ detectTypeOfFile()

std::string WsjcppLightWebHttpResponse::detectTypeOfFile ( const std::string &  sFilePath)
private

◆ forbidden()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::forbidden ( )

◆ internalServerError()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::internalServerError ( )

◆ noCache()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::noCache ( )

◆ notFound()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::notFound ( )

◆ notImplemented()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::notImplemented ( )

◆ ok()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::ok ( )

◆ payloadTooLarge()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::payloadTooLarge ( )

◆ prepareHeaders()

std::string WsjcppLightWebHttpResponse::prepareHeaders ( int  nLength)
private

◆ requestTimeout()

WsjcppLightWebHttpResponse & WsjcppLightWebHttpResponse::requestTimeout ( )

◆ sendBuffer()

void WsjcppLightWebHttpResponse::sendBuffer ( const std::string &  sFilePath,
const char *  pBuffer,
const int  nBufferSize 
)

◆ sendEmpty()

void WsjcppLightWebHttpResponse::sendEmpty ( )

◆ sendFile()

void WsjcppLightWebHttpResponse::sendFile ( const std::string &  sFilePath)

◆ sendJson()

void WsjcppLightWebHttpResponse::sendJson ( const nlohmann::json &  json)

◆ sendOptions()

void WsjcppLightWebHttpResponse::sendOptions ( const std::string &  sOptions)

◆ sendText()

void WsjcppLightWebHttpResponse::sendText ( const std::string &  sBody)

Member Data Documentation

◆ g_mapReponseDescription

std::map< int, std::string > * WsjcppLightWebHttpResponse::g_mapReponseDescription = nullptr
static

◆ m_bClosed

bool WsjcppLightWebHttpResponse::m_bClosed
private

◆ m_nResponseCode

int WsjcppLightWebHttpResponse::m_nResponseCode
private

◆ m_nSockFd

int WsjcppLightWebHttpResponse::m_nSockFd
private

◆ m_sCacheControl

std::string WsjcppLightWebHttpResponse::m_sCacheControl
private

◆ m_sDataType

std::string WsjcppLightWebHttpResponse::m_sDataType
private

◆ m_sLastModified

std::string WsjcppLightWebHttpResponse::m_sLastModified
private

◆ TAG

std::string WsjcppLightWebHttpResponse::TAG
private

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