source: cheroxy/trunk/include/CRXHttpResponse.h@ 26

Last change on this file since 26 was 26, checked in by cheese, 12 years ago

#1 add function to reset request and response

File size: 1.3 KB
RevLine 
[5]1/**
2 * CRXHttpResponse.h
3 */
4#ifndef __CRXHTTPRESPONSE_H__
5#define __CRXHTTPRESPONSE_H__
6
7#include "CRXHttpMessage.h"
8
[24]9#define ERROR_HTTP_RESPONSE -4000
10#define ERROR_HTTP_RESPONSE_INVALID_LENGTH ERROR_HTTP_RESPONSE - 1
11#define ERROR_HTTP_RESPONSE_INVALID_FORMAT ERROR_HTTP_RESPONSE - 2
12#define ERROR_HTTP_RESPONSE_FAILED_TO_MEMORY_ALLOCATION ERROR_HTTP_RESPONSE - 3
13#define ERROR_HTTP_RESPONSE_FAILED_TO_PARSE_CONTENT ERROR_HTTP_RESPONSE - 4
14
[5]15class CRXHttpResponse : public CRXHttpMessage
16{
17private:
18 int mStatusCode;
19 std::string mStatusString;
[24]20 bool mIsChunked; /* Transfer-Encoding */
21 int mContentLength;
[5]22
[24]23 struct __content_body__ {
24 char * mBody;
25 int mLength;
26 } mContent;
27
[5]28public:
[24]29 CRXHttpResponse (void);
30 ~CRXHttpResponse (void);
[5]31
32private:
[24]33 void Parse (void);
34 int ParseContent (const char * aContent,
35 const int aLength);
[26]36 void Reset (void);
[24]37 void ResetContent (void);
[5]38
39public:
[24]40 int GetStatusCode (void) const;
[5]41
[24]42 int SetResponse (const char * aHttpResponse,
43 const int aResponseLength);
44 std::string GetHeader (void) const;
45 const char * GetContentBody (void) const;
46 int GetContentLength (void) const;
[5]47
[24]48 CRXHttpResponse & operator = (const char * aHttpResponse);
[5]49};
50
51#endif // #ifndef __CRXHTTPRESPONSE_H__
Note: See TracBrowser for help on using the repository browser.