OSDN Git Service

Refactoring HTTP parser.
[ultramonkey-l7/sslproxy.git] / include / http_response.h
1 /*
2  * @file  http_response.h
3  * @brief HTTP Response Message Header
4  *
5  * Copyright (C) 2009  NTT COMWARE Corporation.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  **********************************************************************/
23
24 #ifndef __HTTP_RESPONSE_H__
25 #define __HTTP_RESPONSE_H__
26
27 #include <string>
28 #include "http_message.h"
29 #include "http_response_enum.h"
30 #include "logger_wrapper.h"
31
32 //! HTTP Response Class (RFC2616)
33 class http_response : public http_message
34 {
35 private:
36     std::string         _http_version;
37     std::string         _status_code;
38     std::string         _reason_phrase;
39
40 public:
41     http_response();
42     http_response( std::string );
43     ~http_response();
44
45     std::string http_version();
46     std::string http_version( std::string );
47     std::string status_code();
48     std::string status_code( std::string );
49     std::string reason_phrase();
50     std::string reason_phrase( std::string );
51     std::string status_line();
52     std::string as_string();
53     void parse( std::string );
54     void rebuild();
55 };
56
57 #endif //__HTTP_RESPONSE_H__