reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ExistsOrDataParameter.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#include "rutil/ResipAssert.h"
9#include "rutil/Logger.hxx"
10#include "rutil/ParseBuffer.hxx"
11//#include "rutil/WinLeakCheck.hxx" // not compatible with placement new used below
12
13namespace resip
14{
15
16#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
17
18
23
25 ParseBuffer& pb,
26 const std::bitset<256>& terminators)
27 : DataParameter(type, pb, terminators)
28{
29}
30
35
38 ParseBuffer& pb,
39 const std::bitset<256>& terminators,
40 PoolBase* pool)
41{
42 //pb.skipWhitespace(); // whitespace may be a terminator - don't skip it
43 if (pb.eof() || terminators[*pb.position()])
44 {
45 return new (pool) ExistsOrDataParameter(type);
46 }
47 else
48 {
49 return new (pool) ExistsOrDataParameter(type, pb, terminators);
50 }
51}
52
55{
56 return new ExistsOrDataParameter(*this);
57}
58
61{
62 if (mValue.empty())
63 {
64 return stream << getName();
65 }
66 else
67 {
68 return DataParameter::encode(stream);
69 }
70}
71
72} // namespace resip
Generically represents miscellaneous parameter data.
virtual EncodeStream & encode(EncodeStream &stream) const
bool empty() const noexcept
Checks whether the Data is empty.
Definition Data.hxx:591
static Parameter * decode(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
virtual EncodeStream & encode(EncodeStream &stream) const
ExistsOrDataParameter(ParameterTypes::Type)
virtual Parameter * clone() const
virtual const Data & getName() const
Definition Parameter.cxx:23
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition position() const
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream