reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Cookie.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
9
10using namespace resip;
11
12//====================
13// Cookie
14//====================
16 mName(),
17 mValue()
18{}
19
20Cookie::Cookie(const Data& name, const Data& value) :
21 mName(name.urlDecoded()),
22 mValue(value.urlDecoded())
23{}
24
25Cookie&
27{
28 if (this != &rhs)
29 {
30 mName = rhs.mName;
31 mValue = rhs.mValue;
32 }
33 return *this;
34}
35
36bool
37Cookie::operator==(const Cookie& other) const
38{
39 return name() == other.name() && value() == other.value();
40}
41
42bool Cookie::operator<(const Cookie& rhs) const
43{
44 return name() + value() < rhs.name() + rhs.value();
45}
46
48resip::operator<<(EncodeStream& strm, const Cookie& c)
49{
50 strm << c.name() << Symbols::EQUALS[0] << c.value();
51 return strm;
52}
53
54const Data&
56{
57 return mName;
58}
59
60Data&
62{
63 return mName;
64}
65
66const Data&
68{
69 return mValue;
70}
71
72Data&
74{
75 return mValue;
76}
77
78/* ====================================================================
79 * BSD License
80 *
81 * Copyright (c) 2013 Catalin Constantin Usurelu All rights reserved.
82 *
83 * Redistribution and use in source and binary forms, with or without
84 * modification, are permitted provided that the following conditions
85 * are met:
86 *
87 * 1. Redistributions of source code must retain the above copyright
88 * notice, this list of conditions and the following disclaimer.
89 *
90 * 2. Redistributions in binary form must reproduce the above copyright
91 * notice, this list of conditions and the following disclaimer in
92 * the documentation and/or other materials provided with the
93 * distribution.
94 *
95 * 3. Neither the name of the author(s) nor the names of any contributors
96 * may be used to endorse or promote products derived from this software
97 * without specific prior written permission.
98 *
99 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
100 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
101 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
102 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
103 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
104 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
105 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
106 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
107 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
108 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
109 * SUCH DAMAGE.
110 *
111 * ====================================================================
112 *
113 */
bool operator<(const Cookie &rhs) const
Definition Cookie.cxx:42
bool operator==(const Cookie &other) const
Definition Cookie.cxx:37
const Data & name() const
Definition Cookie.cxx:55
const Data & value() const
Definition Cookie.cxx:67
Cookie & operator=(const Cookie &)
Definition Cookie.cxx:26
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const char * EQUALS
Definition Symbols.hxx:29
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
#define EncodeStream