/[resiprocate]/main/sip/resiprocate/GenericUri.cxx
ViewVC logotype

Contents of /main/sip/resiprocate/GenericUri.cxx

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27