Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cHttpCommon.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cHttpCommon_H
7 #define _INC_cHttpCommon_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../GrayLibBase.h"
14 
15 namespace GrayLib
16 {
18 
19 #define HTTP_VER_10 "HTTP/1.0"
20 #define HTTP_VER_11 "HTTP/1.1"
21 #define RTSP_VER "RTSP/1.0"
22 
24  {
28  HTTPRET_UNK = -1,
29 #define cHttpReturnType(a,b,c) HTTPRET_##a = b,
30 #include "cHttpReturns.tbl"
31 #undef cHttpReturnType
33  };
34 
36  {
39 #define cHttpVerb(a,b,c) HTTPVERB_##a,
40 #include "cHttpVerbs.tbl"
41 #undef cHttpVerb
43  };
44 
45  struct GRAYLIB_LINK cHttpCommon // static
46  {
49  public:
50 #define HTTP_CR "\r\n"
51  static const size_t k_CR_SIZE = 2;
52  static const char* k_Space;
53  static const char* const k_szVerbs[HTTPVERB_QTY + 1];
54  static const cPairT<HTTPRET_TYPE, HRESULT> k_HttpReturnErrors[];
55 
56  public:
57  static HTTPVERB_TYPE GRAYCALL FindVerb(const char* pszVerb);
58  static HTTPRET_TYPE GRAYCALL GetErrorHttpRet(HRESULT hRes);
59  static HRESULT GRAYCALL GetErrorHResult(HTTPRET_TYPE eRetCode);
60  static cStringA GRAYCALL GetErrorText(HTTPRET_TYPE eRetCode);
61 
63  };
64 };
65 #endif // _INC_cHttpCommon_H
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cMesh.h:22
HTTPRET_TYPE
Definition: cHttpCommon.h:24
@ HTTPRET_UNK
no code that i understand.
Definition: cHttpCommon.h:28
@ HTTPRET_QTY
Definition: cHttpCommon.h:32
HTTPVERB_TYPE
Definition: cHttpCommon.h:36
@ HTTPVERB_QTY
Definition: cHttpCommon.h:42
UNITTEST2_PREDEF(cQuadtree)
Definition: cHttpCommon.h:46
static const char * k_Space
" "
Definition: cHttpCommon.h:52
UNITTEST_FRIEND(cHttpCommon)