reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
QValueParameter.hxx
Go to the documentation of this file.
1#if !defined(RESIP_QVALUEPARAMETER_HXX)
2#define RESIP_QVALUEPARAMETER_HXX
3
5
9#include "rutil/PoolBase.hxx"
10#include <iosfwd>
11
12namespace resip
13{
14
15 class ParseBuffer;
16
59 {
60 public:
61 typedef QValue Type;
62
73 QValueParameter(ParameterTypes::Type, ParseBuffer& pb, const std::bitset<256>& terminators);
80
92 ParseBuffer& pb,
93 const std::bitset<256>& terminators,
94 PoolBase* pool)
95 {
96 return new (pool) QValueParameter(type, pb, terminators);
97 }
98
103 virtual Parameter* clone() const;
104
110 virtual EncodeStream& encode(EncodeStream& stream) const;
111
112 Type& value() {return mValue;}
113 int qval() const {return mValue.getValue();}
114
115 private:
116 Type mValue;
117 };
118
127 EncodeStream& operator<<(EncodeStream& stream, const QValue& qvalue);
128
129}
130
131#endif
132
133/* ====================================================================
134 * The Vovida Software License, Version 1.0
135 *
136 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
137 *
138 * Redistribution and use in source and binary forms, with or without
139 * modification, are permitted provided that the following conditions
140 * are met:
141 *
142 * 1. Redistributions of source code must retain the above copyright
143 * notice, this list of conditions and the following disclaimer.
144 *
145 * 2. Redistributions in binary form must reproduce the above copyright
146 * notice, this list of conditions and the following disclaimer in
147 * the documentation and/or other materials provided with the
148 * distribution.
149 *
150 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
151 * and "Vovida Open Communication Application Library (VOCAL)" must
152 * not be used to endorse or promote products derived from this
153 * software without prior written permission. For written
154 * permission, please contact vocal@vovida.org.
155 *
156 * 4. Products derived from this software may not be called "VOCAL", nor
157 * may "VOCAL" appear in their name, without prior written
158 * permission of Vovida Networks, Inc.
159 *
160 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
161 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
162 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
163 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
164 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
165 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
166 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
167 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
168 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
169 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
170 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
171 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
172 * DAMAGE.
173 *
174 * ====================================================================
175 *
176 * This software consists of voluntary contributions made by Vovida
177 * Networks, Inc. and many individuals on behalf of Vovida Networks,
178 * Inc. For more information on Vovida Networks, Inc., please see
179 * <http://www.vovida.org/>.
180 *
181 */
Provides string-parsing functionality with protection from buffer overflow.
Represents the "q" parameter value of the RFC 3261 grammar.
static Parameter * decode(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
creates a QValueParameter object and returns a pointer to it.
virtual EncodeStream & encode(EncodeStream &stream) const
returns "q=3" or equivalent in the stream it receives
virtual Parameter * clone() const
creates a new QValueParameter object that is a copy of this one.
int getValue() const
Definition QValue.hxx:75
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
Replaces STL streams for general encoding purposes.
#define EncodeStream