/[resiprocate]/branches/b-identity-0505/CallId.cxx
ViewVC logotype

Contents of /branches/b-identity-0505/CallId.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 3920 byte(s)
set svn:eol-style to LF
1 #if defined(HAVE_CONFIG_H)
2 #include "resiprocate/config.hxx"
3 #endif
4
5 #include "resiprocate/CallId.hxx"
6 #include "resiprocate/UnknownParameter.hxx"
7 #include "resiprocate/os/Data.hxx"
8 #include "resiprocate/os/DnsUtil.hxx"
9 #include "resiprocate/os/Logger.hxx"
10 #include "resiprocate/os/ParseBuffer.hxx"
11 #include "resiprocate/os/WinLeakCheck.hxx"
12
13 using namespace resip;
14 using namespace std;
15
16
17 #define RESIPROCATE_SUBSYSTEM Subsystem::SIP
18
19 //====================
20 // CallID:
21 //====================
22 CallID::CallID()
23 : ParserCategory(),
24 mValue()
25 {}
26
27 CallID::CallID(HeaderFieldValue* hfv,
28 Headers::Type type)
29 : ParserCategory(hfv, type), mValue()
30 {}
31
32 CallID::CallID(const CallID& rhs)
33 : ParserCategory(rhs),
34 mValue(rhs.mValue)
35 {}
36
37 CallID&
38 CallID::operator=(const CallID& rhs)
39 {
40 if (this != &rhs)
41 {
42 ParserCategory::operator=(rhs);
43 mValue = rhs.mValue;
44 }
45 return *this;
46 }
47
48 bool
49 CallID::operator==(const CallID& rhs) const
50 {
51 return value() == rhs.value();
52 }
53
54 ParserCategory *
55 CallID::clone() const
56 {
57 return new CallID(*this);
58 }
59
60 Data&
61 CallID::value()
62 {
63 checkParsed();
64 return mValue;
65 }
66
67 const Data&
68 CallID::value() const
69 {
70 checkParsed();
71 return mValue;
72 }
73
74 void
75 CallID::parse(ParseBuffer& pb)
76 {
77 const char* start = pb.skipWhitespace();
78 pb.skipToOneOf(ParseBuffer::Whitespace, Symbols::SEMI_COLON);
79 pb.data(mValue, start);
80
81 parseParameters(pb);
82 }
83
84 ostream&
85 CallID::encodeParsed(ostream& str) const
86 {
87 str << mValue;
88 encodeParameters(str);
89 return str;
90 }
91
92
93
94
95 /* ====================================================================
96 * The Vovida Software License, Version 1.0
97 *
98 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
99 *
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted provided that the following conditions
102 * are met:
103 *
104 * 1. Redistributions of source code must retain the above copyright
105 * notice, this list of conditions and the following disclaimer.
106 *
107 * 2. Redistributions in binary form must reproduce the above copyright
108 * notice, this list of conditions and the following disclaimer in
109 * the documentation and/or other materials provided with the
110 * distribution.
111 *
112 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
113 * and "Vovida Open Communication Application Library (VOCAL)" must
114 * not be used to endorse or promote products derived from this
115 * software without prior written permission. For written
116 * permission, please contact vocal@vovida.org.
117 *
118 * 4. Products derived from this software may not be called "VOCAL", nor
119 * may "VOCAL" appear in their name, without prior written
120 * permission of Vovida Networks, Inc.
121 *
122 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
123 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
125 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
126 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
127 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
128 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
129 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
130 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
131 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
132 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
133 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
134 * DAMAGE.
135 *
136 * ====================================================================
137 *
138 * This software consists of voluntary contributions made by Vovida
139 * Networks, Inc. and many individuals on behalf of Vovida Networks,
140 * Inc. For more information on Vovida Networks, Inc., please see
141 * <http://www.vovida.org/>.
142 *
143 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27