Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
cgicc
HTTPCookie.h
Go to the documentation of this file.
1
/* -*-mode:c++; c-file-style: "gnu";-*- */
2
/*
3
* $Id: HTTPCookie.h,v 1.9 2009/01/18 13:58:25 sebdiaz Exp $
4
*
5
* Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
6
* 2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
7
* Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 3 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
22
*/
23
24
#ifndef _HTTPCOOKIE_H_
25
#define _HTTPCOOKIE_H_ 1
26
27
#ifdef __GNUG__
28
# pragma interface
29
#endif
30
35
#include <string>
36
37
#include "
cgicc/MStreamable.h
"
38
#include "
cgicc/CgiDefs.h
"
39
40
namespace
cgicc {
41
42
// ============================================================
43
// Class HTTPCookie
44
// ============================================================
58
class
CGICC_API
HTTPCookie
:
public
MStreamable
59
{
60
public
:
61
64
70
HTTPCookie
();
71
79
HTTPCookie
(
const
std::string& name,
80
const
std::string& value);
81
98
HTTPCookie
(
const
std::string& name,
99
const
std::string& value,
100
const
std::string&
comment
,
101
const
std::string& domain,
102
unsigned
long
maxAge,
103
const
std::string& path,
104
bool
secure);
105
113
HTTPCookie
(
const
HTTPCookie
& cookie);
114
120
virtual
~
HTTPCookie
();
122
123
// ============================================================
124
127
136
bool
137
operator== (
const
HTTPCookie
& cookie)
const
;
138
147
inline
bool
148
operator != (
const
HTTPCookie
& cookie)
const
149
{
return
! operator==(cookie); }
150
151
#ifdef WIN32
152
/* Dummy operator for MSVC++ */
153
inline
bool
154
operator< (
const
HTTPCookie
& cookie)
const
155
{
return
false
; }
156
#endif
157
158
159
// ============================================================
160
163
168
inline
void
169
remove
()
170
{ fRemoved =
true
; }
171
177
inline
void
178
setRemoved(
bool
removed)
179
{ fRemoved = removed; }
185
inline
bool
186
isRemoved()
const
187
{
return
fRemoved; }
200
HTTPCookie
(
const
std::string& name,
201
const
std::string& domain,
202
const
std::string& path,
203
bool
secure);
204
210
inline
std::string
211
getName()
const
212
{
return
fName; }
213
219
inline
std::string
220
getValue
()
const
221
{
return
fValue; }
222
228
inline
std::string
229
getComment()
const
230
{
return
fComment; }
231
239
inline
std::string
240
getDomain()
const
241
{
return
fDomain; }
242
248
inline
unsigned
long
249
getMaxAge()
const
250
{
return
fMaxAge; }
251
259
inline
std::string
260
getPath()
const
261
{
return
fPath; }
262
268
inline
bool
269
isSecure()
const
270
{
return
fSecure; }
272
273
// ============================================================
274
277
283
inline
void
284
setName(
const
std::string& name)
285
{ fName = name; }
286
292
inline
void
293
setValue(
const
std::string& value)
294
{ fValue = value; }
295
301
inline
void
302
setComment(
const
std::string& comment)
303
{ fComment = comment; }
304
313
inline
void
314
setDomain(
const
std::string& domain)
315
{ fDomain = domain; }
316
323
inline
void
324
setMaxAge(
unsigned
long
maxAge)
325
{ fMaxAge = maxAge; }
326
334
inline
void
335
setPath(
const
std::string& path)
336
{ fPath = path; }
337
343
inline
void
344
setSecure(
bool
secure)
345
{ fSecure = secure; }
347
348
// ============================================================
349
352
virtual
void
353
render(std::ostream& out)
const
;
355
356
private
:
357
std::string fName;
358
std::string fValue;
359
std::string fComment;
360
std::string fDomain;
361
unsigned
long
fMaxAge;
362
std::string fPath;
363
bool
fSecure;
364
bool
fRemoved;
365
};
366
367
}
// namespace cgicc
368
369
#endif
/* ! _HTTPCOOKIE_H_ */
GNU cgicc
- A C++ class library for writing CGI applications
Copyright © 1996 - 2004
Stephen F. Booth
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.
Documentation generated Fri Jul 12 2013 14:34:55 for cgicc by
doxygen
1.8.3.1