1#if defined(HAVE_CONFIG_H)
22#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
37 mHeaderType(headerType)
67 mHeaderType(rhs.mHeaderType)
71 copyParametersFrom(rhs);
85 copyParametersFrom(rhs);
92ParserCategory::clear()
116 for (ParameterList::const_iterator it = other.
mParameters.begin();
140 InfoLog(<<
"Referenced an unknown parameter " <<
param.getName());
141 throw Exception(
"Missing unknown parameter", __FILE__, __LINE__);
185 for (ParameterList::iterator it =
mParameters.begin();
188 if (set.find((*it)->getType()) == set.end())
224 static std::bitset<256> terminators1=
Data::toBitset(
" \t\r\n;=?>");
227 if((
int)(keyEnd-keyStart) != 0)
230 static std::bitset<256> terminators2 =
Data::toBitset(
" \t\r\n;?>");
236 int((keyEnd - keyStart)),
277 InfoLog(<<
"Duplicate parameter-name \"" <<
param->getName() <<
"\", skip it.");
287 const Data& unknownParamName = unknownParam->
getName();
298 InfoLog(<<
"Duplicate parameter-name \"" << unknownParamName <<
"\", skip it.");
315 for (ParameterList::const_iterator it =
mParameters.begin();
323 if ( type == ParameterTypes::tag )
381 return category.
encode(stream);
387 for (ParameterList::const_iterator it =
mParameters.begin();
390 if ((*it)->getType() == type)
403 for (ParameterList::iterator it =
mParameters.begin();
406 if ((*it)->getType() == parameter->
getType())
424 for (ParameterList::iterator it =
mParameters.begin();
427 if ((*it)->getType() == type)
460 if ((*it)->getName() == data)
480 if ((*i)->getType() != ParameterTypes::lr)
496 buffer += p->
value();
static Data up_Msgr("msgr")
#define resip_assert(x)
This file needs to work for both C and C++ code.
Generically represents miscellaneous parameter data.
An iostream that operates on an existing Data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
bool empty() const noexcept
Checks whether the Data is empty.
Data & clear()
Clears the contents of this Data.
static std::bitset< 256 > toBitset(const resip::Data &chars)
Creates a bitset reflecting the contents of this data (as a set) ie.
The base-class for all lazily-parsed SIP grammar elements.
EncodeStream & encode(EncodeStream &str) const
Encodes this element to a stream, in the fashion it should be represented on the wire.
LazyParser & operator=(const LazyParser &rhs)
bool isParsed() const
Returns true iff a parse has been attempted.
virtual ParameterTypes::Type getTypeNum() const =0
static Type getType(const char *start, size_t length)
does a convert to enum from a pointer into the HFV raw buffer
virtual Parameter * clone() const =0
ParameterTypes::Type getType() const
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipWhitespace()
CurrentPosition position() const
void reset(const char *pos)
CurrentPosition skipToOneOf(const char *cs)
CurrentPosition skipChar()
Exception class used by ParserCategory.
Base class for all SIP grammar elements that can have parameters.
void removeParameterByData(const Data &data)
void remove(const ParamBase ¶mType)
Removes a natively supported parameter, if the parameter is present.
void clearUnknownParameters()
void setParameter(const Parameter *parameter)
Parameter * getParameterByData(const Data &data) const
Parameter * getParameterByEnum(ParameterTypes::Type type) const
Data commutativeParameterHash() const
ParserCategory(const HeaderFieldValue &headerFieldValue, Headers::Type type, PoolBase *pool=0)
ParameterList mUnknownParameters
ParserCategory & operator=(const ParserCategory &rhs)
void removeParameterByEnum(ParameterTypes::Type type)
void parseParameters(ParseBuffer &pb)
bool addParameter(Parameter *param)
ParameterList mParameters
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
static const ParameterTypeSet EmptyParameterTypeSet
Headers::Type mHeaderType
EncodeStream & encodeParameters(EncodeStream &str) const
Encodes parameters as they should appear on the wire.
virtual const Data & errorContext() const
bool exists(const ParamBase ¶mType) const
Checks for the existence of a natively supported parameter.
virtual ~ParserCategory()
std::set< ParameterTypes::Type > ParameterTypeSet
void removeParametersExcept(const ParameterTypeSet &set=EmptyParameterTypeSet)
Removes all known parameters except those that are specified in set.
void freeParameter(Parameter *p)
const Data & param(const ExtensionParameter ¶m) const
Const accessor for non-natively-supported parameter types.
A dirt-simple lightweight stl pool allocator meant for use in short-lifetime objects.
static const char * SEMI_COLON
static const char * SPACE
Generically used to represent any parameter that is not known by the implmentation.
virtual const Data & getName() const
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
dcm! – add UnusedChecking(_enum) below;
bool isEqualNoCase(const Data &left, const Data &right)
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)