reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
DataParameter.hxx
Go to the documentation of this file.
1#if !defined(RESIP_DATAPARAMETER_HXX)
2#define RESIP_DATAPARAMETER_HXX
3
6#include "rutil/Data.hxx"
7#include "rutil/PoolBase.hxx"
8#include <iosfwd>
9
10namespace resip
11{
12
13class ParseBuffer;
14
15
21{
22 public:
23 typedef Data Type;
24
26 const std::bitset<256>& terminators);
28
29 bool isQuoted() const { return mQuoted; }
30 void setQuoted(bool b) { mQuoted = b; }; // this parameter will be enclosed in quotes e.g. "foo"
31
33 ParseBuffer& pb,
34 const std::bitset<256>& terminators,
35 PoolBase* pool)
36 {
37 return new (pool) DataParameter(type, pb, terminators);
38 }
39
40 virtual Parameter* clone() const;
41 virtual EncodeStream& encode(EncodeStream& stream) const;
42
43 Type& value() {return mValue;} // does not return a quoted string
44 protected:
46 : Parameter(other),
47 mValue(other.mValue),
48 mQuoted(other.mQuoted)
49 {
50 }
51
53 bool mQuoted;
54};
55
56}
57
58#endif
59
60
61/* ====================================================================
62 * The Vovida Software License, Version 1.0
63 *
64 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
65 *
66 * Redistribution and use in source and binary forms, with or without
67 * modification, are permitted provided that the following conditions
68 * are met:
69 *
70 * 1. Redistributions of source code must retain the above copyright
71 * notice, this list of conditions and the following disclaimer.
72 *
73 * 2. Redistributions in binary form must reproduce the above copyright
74 * notice, this list of conditions and the following disclaimer in
75 * the documentation and/or other materials provided with the
76 * distribution.
77 *
78 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
79 * and "Vovida Open Communication Application Library (VOCAL)" must
80 * not be used to endorse or promote products derived from this
81 * software without prior written permission. For written
82 * permission, please contact vocal@vovida.org.
83 *
84 * 4. Products derived from this software may not be called "VOCAL", nor
85 * may "VOCAL" appear in their name, without prior written
86 * permission of Vovida Networks, Inc.
87 *
88 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
89 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
90 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
91 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
92 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
93 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
94 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
95 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
96 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
97 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
98 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
99 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
100 * DAMAGE.
101 *
102 * ====================================================================
103 *
104 * This software consists of voluntary contributions made by Vovida
105 * Networks, Inc. and many individuals on behalf of Vovida Networks,
106 * Inc. For more information on Vovida Networks, Inc., please see
107 * <http://www.vovida.org/>.
108 *
109 */
Generically represents miscellaneous parameter data.
static Parameter * decode(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
DataParameter(const DataParameter &other)
virtual EncodeStream & encode(EncodeStream &stream) const
virtual Parameter * clone() const
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Provides string-parsing functionality with protection from buffer overflow.
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream