Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cHttpCommon Struct Reference

#include <cHttpCommon.h>

Inheritance diagram for GrayLib::cHttpCommon:
GrayLib::cHttpClient GrayLib::cHttpProtocolStreamBase GrayLib::cHttpCopier GrayLib::cHttpProtocolStream GrayLib::cHttpScriptedProtocolStream GrayLib::cWebAPIClient

Public Member Functions

 UNITTEST_FRIEND (cHttpCommon)
 

Static Public Member Functions

static HTTPVERB_TYPE GRAYCALL FindVerb (const char *pszVerb)
 
static HTTPRET_TYPE GRAYCALL GetErrorHttpRet (HRESULT hRes)
 
static HRESULT GRAYCALL GetErrorHResult (HTTPRET_TYPE eRetCode)
 
static cStringA GRAYCALL GetErrorText (HTTPRET_TYPE eRetCode)
 

Static Public Attributes

static const size_t k_CR_SIZE = 2
 sizeof HTTP_CR "\r\n" More...
 
static const char * k_Space = "&nbsp;"
 "&nbsp;" More...
 
static const char *const k_szVerbs [HTTPVERB_QTY+1]
 
static const cPairT< HTTPRET_TYPE, HRESULTk_HttpReturnErrors []
 

Detailed Description

Both client and server use these.

Member Function Documentation

◆ FindVerb()

HTTPVERB_TYPE GRAYCALL GrayLib::cHttpCommon::FindVerb ( const char *  pszVerb)
static

http://en.wikipedia.org/wiki/HTTP Get the HTTP 'verb' - what they want to do with the connection.

◆ GetErrorHResult()

HRESULT GRAYCALL GrayLib::cHttpCommon::GetErrorHResult ( HTTPRET_TYPE  eRetCode)
static

Make the HTTP code into a HRESULT type code. (e.g. HRESULT_WIN32_C(ERROR_INTERNAL_ERROR)) else use a FACILITY_HTTP code.

◆ GetErrorHttpRet()

HTTPRET_TYPE GRAYCALL GrayLib::cHttpCommon::GetErrorHttpRet ( HRESULT  hRes)
static

◆ GetErrorText()

cStringA GRAYCALL GrayLib::cHttpCommon::GetErrorText ( HTTPRET_TYPE  eRetCode)
static

get HTTP error code string description.

◆ UNITTEST_FRIEND()

GrayLib::cHttpCommon::UNITTEST_FRIEND ( cHttpCommon  )

Member Data Documentation

◆ k_CR_SIZE

const size_t GrayLib::cHttpCommon::k_CR_SIZE = 2
static

sizeof HTTP_CR "\r\n"

◆ k_HttpReturnErrors

const cPairT< HTTPRET_TYPE, HRESULT > GrayLib::cHttpCommon::k_HttpReturnErrors
static
Initial value:
=
{
{ HTTPRET_OK, S_OK },
{ HTTPRET_OK_DATA, S_FALSE },
{ HTTPRET_301, COMQC_E_UNTRUSTED_ENQUEUER },
{ HTTPRET_304, HRESULT_WIN32_C(ERROR_DS_ILLEGAL_MOD_OPERATION) },
{ HTTPRET_ER_400, HRESULT_WIN32_C(ERROR_INVALID_NAME) },
{ HTTPRET_ER_401, HRESULT_WIN32_C(ERROR_NOT_AUTHENTICATED) },
{ HTTPRET_ER_403, HRESULT_WIN32_C(ERROR_NETWORK_ACCESS_DENIED) },
{ HTTPRET_ER_450, HRESULT_WIN32_C(ERROR_NETWORK_ACCESS_DENIED) },
{ HTTPRET_ER_404, HRESULT_WIN32_C(ERROR_FILE_NOT_FOUND) },
{ HTTPRET_ER_500, HRESULT_WIN32_C(ERROR_INTERNAL_ERROR) },
{ HTTPRET_ER_501, HRESULT_WIN32_C(ERROR_CALL_NOT_IMPLEMENTED) },
{ HTTPRET_ER_501, E_NOTIMPL },
{ HTTPRET_ER_550, HRESULT_WIN32_C(ERROR_PRIVILEGE_NOT_HELD) },
}
#define HRESULT_WIN32_C(x)
a constant LSTATUS/error_status_t with no check, unlike HRESULT_FROM_WIN32()
Definition: HResult.h:79

◆ k_Space

const char * GrayLib::cHttpCommon::k_Space = "&nbsp;"
static

"&nbsp;"

◆ k_szVerbs

const char *const GrayLib::cHttpCommon::k_szVerbs
static
Initial value:
=
{
#define cHttpVerb(a,b,c)
nullptr,
}

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