DCL
4.0
Loading...
Searching...
No Matches
HttpHeader.h
Go to the documentation of this file.
1
#ifndef __DCL_HTTP_HEADER_H__
2
#define __DCL_HTTP_HEADER_H__ 20050509
3
4
#ifndef __DCL_INCLUDED_TIME_H
5
#include <
dcl/_time.h
>
6
#endif
7
8
#ifndef __DCL_STRING_H__
9
#include <
dcl/String.h
>
10
#endif
11
12
#ifdef __DCL_DEBUG
13
static
const
char_t
* __pszHttpHeader_h__ =
__T
(
"dcl/HttpHeader.h"
);
14
#undef __THIS_FILE__
15
#define __THIS_FILE__ __pszHttpHeader_h__
16
#endif
17
18
__DCL_BEGIN_NAMESPACE
19
20
class
DCLCAPI
HttpHeader
21
{
22
protected
:
23
String
__name
;
24
String
__content
;
25
public
:
26
HttpHeader
();
27
HttpHeader
(
const
HttpHeader
& src);
28
HttpHeader
(
const
wchar_t
* _name,
const
wchar_t
* _content =
NULL
);
29
const
String&
name
()
const
;
30
const
String&
content
()
const
;
31
String
toString
()
const
;
32
};
33
34
class
DCLCAPI
HttpSetCookie
:
public
HttpHeader
35
{
36
public
:
37
// http://www.faqs.org/rfcs/rfc2109.html
38
#ifdef RFC2109
39
HttpSetCookie
(
const
wchar_t
* _name,
40
const
wchar_t
* _value =
NULL
,
41
const
wchar_t
* _comment =
NULL
,
42
const
wchar_t
* _domain =
NULL
,
43
int
_maxAge = 0,
// 초 단위
44
const
wchar_t
* _path =
NULL
,
45
bool
_secure =
false
,
46
int
nVersion = 0
47
);
48
#endif
// RFC2109
49
// php style
50
HttpSetCookie
(
const
wchar_t
* _name,
51
const
wchar_t
* _value =
NULL
,
52
time_t _expires = 0,
53
const
wchar_t
* _path =
NULL
,
54
const
wchar_t
* _domain =
NULL
,
55
bool
_secure =
false
56
);
57
};
58
59
// http://www.faqs.org/rfcs/rfc2965.html
60
class
DCLCAPI
HttpSetCookie2
:
public
HttpHeader
61
{
62
63
};
64
65
class
DCLCAPI
HttpExpires
:
public
HttpHeader
66
{
67
public
:
68
HttpExpires
(time_t _expires);
69
};
70
71
inline
HttpHeader::HttpHeader
()
72
{
73
}
74
75
inline
HttpHeader::HttpHeader
(
const
HttpHeader
& src)
76
{
77
__name
= src.
__name
;
78
__content
= src.
__content
;
79
}
80
81
inline
HttpHeader::HttpHeader
(
const
wchar_t
* _name,
const
wchar_t
* _content
/* = NULL */
)
82
{
83
__DCL_ASSERT
(_name !=
NULL
);
84
__DCL_ASSERT
(*_name != L
'\0'
);
85
86
__name
= _name;
87
88
if
(_content !=
NULL
)
89
__content
= _content;
90
}
91
92
inline
const
String&
HttpHeader::name
()
const
93
{
94
return
__name
;
95
}
96
97
inline
const
String&
HttpHeader::content
()
const
98
{
99
return
__content
;
100
}
101
102
inline
bool
operator ==
(
const
HttpHeader
& x,
const
HttpHeader
& y)
103
{
104
return
(x.
name
() == y.
name
()) && (x.
content
() == y.
content
());
105
}
106
107
__DCL_END_NAMESPACE
108
109
#ifdef __DCL_DEBUG
110
#undef __THIS_FILE__
111
#define __THIS_FILE__ __T(__FILE__)
112
#endif
113
114
#endif
// __DCL_HTTP_HEADER_H__
_time.h
NULL
#define NULL
Definition
Config.h:340
DCLCAPI
#define DCLCAPI
Definition
Config.h:100
char_t
wchar_t char_t
Definition
Config.h:275
operator==
bool operator==(const HttpHeader &x, const HttpHeader &y)
Definition
HttpHeader.h:102
__DCL_ASSERT
#define __DCL_ASSERT(expr)
Definition
Object.h:371
__T
#define __T(str)
Definition
Object.h:44
String.h
HttpExpires::HttpExpires
HttpExpires(time_t _expires)
Definition
HttpHeader.cpp:143
HttpHeader
Definition
HttpHeader.h:21
HttpHeader::HttpHeader
HttpHeader()
Definition
HttpHeader.h:71
HttpHeader::__content
String __content
Definition
HttpHeader.h:24
HttpHeader::content
const String & content() const
Definition
HttpHeader.h:97
HttpHeader::toString
String toString() const
Definition
HttpHeader.cpp:21
HttpHeader::__name
String __name
Definition
HttpHeader.h:23
HttpHeader::name
const String & name() const
Definition
HttpHeader.h:92
HttpSetCookie2
Definition
HttpHeader.h:61
HttpSetCookie::HttpSetCookie
HttpSetCookie(const wchar_t *_name, const wchar_t *_value=NULL, time_t _expires=0, const wchar_t *_path=NULL, const wchar_t *_domain=NULL, bool _secure=false)
Definition
HttpHeader.cpp:100
include
dcl
HttpHeader.h
Generated by
1.14.0