reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::NameAddr Class Reference

Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar. More...

#include <NameAddr.hxx>

Inheritance diagram for resip::NameAddr:
[legend]

Public Member Functions

 NameAddr ()
 
 NameAddr (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0)
 
 NameAddr (const Uri &orig)
 
 NameAddr (const Data &unparsed, bool preCacheAor=false)
 
 NameAddr (const NameAddr &orig, PoolBase *pool=0)
 
NameAddr & operator= (const NameAddr &)
 
bool operator== (const NameAddr &other) const
 
virtual ~NameAddr ()
 
Uri & uri ()
 
const Uri & uri () const
 
Data & displayName ()
 
const Data & displayName () const
 
bool isAllContacts () const
 
void setAllContacts ()
 
virtual void parse (ParseBuffer &pb)
 
virtual ParserCategory * clone () const
 
virtual ParserCategory * clone (void *location) const
 
virtual ParserCategory * clone (PoolBase *pool) const
 
virtual EncodeStream & encodeParsed (EncodeStream &str) const
 
bool operator< (const NameAddr &other) const
 
virtual Parameter * createParam (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
 
bool exists (const Param< NameAddr > &paramType) const
 
void remove (const Param< NameAddr > &paramType)
 
 defineParam (data, "data", ExistsParameter, "RFC 3840")
 
 defineParam (control, "control", ExistsParameter, "RFC 3840")
 
 defineParam (mobility, "mobility", QuotedDataParameter, "RFC 3840")
 
 defineParam (description, "description", QuotedDataParameter, "RFC 3840")
 
 defineParam (events, "events", QuotedDataParameter, "RFC 3840")
 
 defineParam (priority, "priority", QuotedDataParameter, "RFC 3840")
 
 defineParam (methods, "methods", QuotedDataParameter, "RFC 3840")
 
 defineParam (schemes, "schemes", QuotedDataParameter, "RFC 3840")
 
 defineParam (application, "application", ExistsParameter, "RFC 3840")
 
 defineParam (video, "video", ExistsParameter, "RFC 3840")
 
 defineParam (language, "language", QuotedDataParameter, "RFC 3840")
 
 defineParam (type, "type", QuotedDataParameter, "RFC 3840")
 
 defineParam (isFocus, "isfocus", ExistsParameter, "RFC 3840")
 
 defineParam (actor, "actor", QuotedDataParameter, "RFC 3840")
 
 defineParam (text, "text", ExistsOrDataParameter, "RFC 3840")
 
 defineParam (extensions, "extensions", QuotedDataParameter, "RFC 3840")
 
 defineParam (Instance, "+sip.instance", QuotedDataParameter, "RFC 5626")
 
 defineParam (regid, "reg-id", UInt32Parameter, "RFC 5626")
 
 defineParam (pubGruu, "pub-gruu", QuotedDataParameter, "RFC 5627")
 
 defineParam (tempGruu, "temp-gruu", QuotedDataParameter, "RFC 5627")
 
 defineParam (expires, "expires", UInt32Parameter, "RFC 3261")
 
 defineParam (q, "q", QValueParameter, "RFC 3261")
 
 defineParam (tag, "tag", DataParameter, "RFC 3261")
 
 defineParam (index, "index", DataParameter, "RFC 4244")
 
 defineParam (rc, "rc", DataParameter, "RFC 4244-bis")
 
 defineParam (mp, "mp", DataParameter, "RFC 4244-bis")
 
 defineParam (np, "np", DataParameter, "RFC 4244-bis")
 
 defineParam (reason, "reason", DataParameter, "RFC 5806")
 
 defineParam (counter, "counter", UInt32Parameter, "RFC 5806")
 
 defineParam (limit, "limit", UInt32Parameter, "RFC 5806")
 
 defineParam (privacy, "privacy", DataParameter, "RFC 5806")
 
 defineParam (screen, "screen", DataParameter, "RFC 5806")
 
bool exists (const ParamBase &paramType) const
 Checks for the existence of a natively supported parameter.
 
bool exists (const ExtensionParameter &param) const
 Checks for the existence of a non-natively-supported parameter.
 
void remove (const ParamBase &paramType)
 Removes a natively supported parameter, if the parameter is present.
 
void remove (const ExtensionParameter &param)
 Removes a non-natively-supported parameter, if the parameter is present.
 
const Data & param (const ExtensionParameter &param) const
 Const accessor for non-natively-supported parameter types.
 
Data & param (const ExtensionParameter &param)
 Accessor for non-natively-supported parameter types.
 
- Public Member Functions inherited from resip::ParserCategory
 ParserCategory (const HeaderFieldValue &headerFieldValue, Headers::Type type, PoolBase *pool=0)
 
 ParserCategory (const char *buf, int length, Headers::Type type, PoolBase *pool=0)
 
 ParserCategory (const ParserCategory &rhs, PoolBase *pool=0)
 
ParserCategory & operator= (const ParserCategory &rhs)
 
virtual ~ParserCategory ()
 
bool exists (const ParamBase &paramType) const
 Checks for the existence of a natively supported parameter.
 
void remove (const ParamBase &paramType)
 Removes a natively supported parameter, if the parameter is present.
 
const Data & param (const ExtensionParameter &param) const
 Const accessor for non-natively-supported parameter types.
 
Data & param (const ExtensionParameter &param)
 Accessor for non-natively-supported parameter types.
 
void remove (const ExtensionParameter &param)
 Removes a non-natively-supported parameter, if the parameter is present.
 
bool exists (const ExtensionParameter &param) const
 Checks for the existence of a non-natively-supported parameter.
 
void removeParametersExcept (const ParameterTypeSet &set=EmptyParameterTypeSet)
 Removes all known parameters except those that are specified in set.
 
void clearUnknownParameters ()
 
void parseParameters (ParseBuffer &pb)
 
EncodeStream & encodeParameters (EncodeStream &str) const
 Encodes parameters as they should appear on the wire.
 
Data commutativeParameterHash () const
 
Parameter * getParameterByEnum (ParameterTypes::Type type) const
 
void removeParameterByEnum (ParameterTypes::Type type)
 
void setParameter (const Parameter *parameter)
 
int numKnownParams () const
 Returns the number of known (natively supported) parameters.
 
int numUnknownParams () const
 Returns the number of unknown parameters.
 
- Public Member Functions inherited from resip::LazyParser
 LazyParser (const HeaderFieldValue &headerFieldValue)
 
 LazyParser (const char *buf, int length)
 
 LazyParser (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e)
 
 LazyParser (const LazyParser &rhs)
 
 LazyParser (const LazyParser &rhs, HeaderFieldValue::CopyPaddingEnum e)
 
LazyParser & operator= (const LazyParser &rhs)
 
virtual ~LazyParser ()
 
EncodeStream & encode (EncodeStream &str) const
 Encodes this element to a stream, in the fashion it should be represented on the wire.
 
bool isParsed () const
 Returns true iff a parse has been attempted.
 
HeaderFieldValue & getHeaderField ()
 
void checkParsed () const
 
void checkParsed ()
 
void doParse () const
 
void markDirty () const
 
bool isWellFormed () const
 Returns true iff this element was parsed successfully, according to the implementation of parse().
 

Static Public Attributes

static constexpr CommaHandlingMode commaHandling = CommasAllowedOutputMulti
 
- Static Public Attributes inherited from resip::ParserCategory
static const ParameterTypeSet EmptyParameterTypeSet
 

Protected Member Functions

bool mustQuoteDisplayName () const
 
void adjustDisplayNameIfNeeded ()
 
- Protected Member Functions inherited from resip::ParserCategory
 ParserCategory (PoolBase *pool=0)
 
bool addParameter (Parameter *param)
 
bool addParameter (UnknownParameter *unknownParam)
 
Parameter * getParameterByData (const Data &data) const
 
void removeParameterByData (const Data &data)
 
PoolBase * getPool ()
 
void freeParameter (Parameter *p)
 
virtual const Data & errorContext () const
 
- Protected Member Functions inherited from resip::LazyParser
 LazyParser ()
 
void clear ()
 

Protected Attributes

bool mAllContacts
 
Uri mUri
 
Data mDisplayName
 
Data * mUnknownUriParametersBuffer
 
- Protected Attributes inherited from resip::ParserCategory
ParameterList mParameters
 
ParameterList mUnknownParameters
 
PoolBase * mPool
 
Headers::Type mHeaderType
 

Additional Inherited Members

- Public Types inherited from resip::ParserCategory
enum  { UnknownParserCategory = -1 }
 
enum  CommaHandlingMode { NoCommaTokenizing = 0 , CommasAllowedOutputMulti = 1 , CommasAllowedOutputCommas = 3 }
 
typedef std::set< ParameterTypes::Type > ParameterTypeSet
 
- Protected Types inherited from resip::ParserCategory
typedef std::vector< Parameter *, StlPoolAllocator< Parameter *, PoolBase > > ParameterList
 

Detailed Description

Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.

Definition at line 18 of file NameAddr.hxx.

Constructor & Destructor Documentation

◆ NameAddr() [1/5]

NameAddr::NameAddr ( )

Definition at line 22 of file NameAddr.cxx.

◆ NameAddr() [2/5]

NameAddr::NameAddr ( const HeaderFieldValue &  hfv,
Headers::Type  type,
PoolBase *  pool = 0 
)

Definition at line 29 of file NameAddr.cxx.

◆ NameAddr() [3/5]

NameAddr::NameAddr ( const Uri &  orig)
explicit

Definition at line 66 of file NameAddr.cxx.

◆ NameAddr() [4/5]

NameAddr::NameAddr ( const Data &  unparsed,
bool  preCacheAor = false 
)
explicit

Definition at line 49 of file NameAddr.cxx.

◆ NameAddr() [5/5]

NameAddr::NameAddr ( const NameAddr &  orig,
PoolBase *  pool = 0 
)

Definition at line 39 of file NameAddr.cxx.

◆ ~NameAddr()

NameAddr::~NameAddr ( )
virtual

Definition at line 74 of file NameAddr.cxx.

Member Function Documentation

◆ adjustDisplayNameIfNeeded()

void NameAddr::adjustDisplayNameIfNeeded ( )
protected

Definition at line 439 of file NameAddr.cxx.

◆ clone() [1/3]

ParserCategory * NameAddr::clone ( ) const
virtual

Implements resip::ParserCategory.

Definition at line 112 of file NameAddr.cxx.

◆ clone() [2/3]

ParserCategory * NameAddr::clone ( PoolBase *  pool) const
virtual

Implements resip::ParserCategory.

Definition at line 124 of file NameAddr.cxx.

◆ clone() [3/3]

ParserCategory * NameAddr::clone ( void *  location) const
virtual

Implements resip::ParserCategory.

Definition at line 118 of file NameAddr.cxx.

◆ createParam()

Parameter * NameAddr::createParam ( ParameterTypes::Type  type,
ParseBuffer &  pb,
const std::bitset< 256 > &  terminators,
PoolBase *  pool 
)
virtual

Reimplemented from resip::ParserCategory.

Definition at line 467 of file NameAddr.cxx.

◆ defineParam() [1/32]

resip::NameAddr::defineParam ( actor  ,
"actor"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [2/32]

resip::NameAddr::defineParam ( application  ,
"application"  ,
ExistsParameter  ,
"RFC 3840"   
)

◆ defineParam() [3/32]

resip::NameAddr::defineParam ( control  ,
"control"  ,
ExistsParameter  ,
"RFC 3840"   
)

◆ defineParam() [4/32]

resip::NameAddr::defineParam ( counter  ,
"counter"  ,
UInt32Parameter  ,
"RFC 5806"   
)

◆ defineParam() [5/32]

resip::NameAddr::defineParam ( data  ,
"data"  ,
ExistsParameter  ,
"RFC 3840"   
)

◆ defineParam() [6/32]

resip::NameAddr::defineParam ( description  ,
"description"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [7/32]

resip::NameAddr::defineParam ( events  ,
"events"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [8/32]

resip::NameAddr::defineParam ( expires  ,
"expires"  ,
UInt32Parameter  ,
"RFC 3261"   
)

◆ defineParam() [9/32]

resip::NameAddr::defineParam ( extensions  ,
"extensions"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [10/32]

resip::NameAddr::defineParam ( index  ,
"index"  ,
DataParameter  ,
"RFC 4244"   
)

◆ defineParam() [11/32]

resip::NameAddr::defineParam ( Instance  ,
"+sip.instance"  ,
QuotedDataParameter  ,
"RFC 5626"   
)

◆ defineParam() [12/32]

resip::NameAddr::defineParam ( isFocus  ,
"isfocus"  ,
ExistsParameter  ,
"RFC 3840"   
)

◆ defineParam() [13/32]

resip::NameAddr::defineParam ( language  ,
"language"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [14/32]

resip::NameAddr::defineParam ( limit  ,
"limit"  ,
UInt32Parameter  ,
"RFC 5806"   
)

◆ defineParam() [15/32]

resip::NameAddr::defineParam ( methods  ,
"methods"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [16/32]

resip::NameAddr::defineParam ( mobility  ,
"mobility"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [17/32]

resip::NameAddr::defineParam ( mp  ,
"mp"  ,
DataParameter  ,
"RFC 4244-bis"   
)

◆ defineParam() [18/32]

resip::NameAddr::defineParam ( np  ,
"np"  ,
DataParameter  ,
"RFC 4244-bis"   
)

◆ defineParam() [19/32]

resip::NameAddr::defineParam ( priority  ,
"priority"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [20/32]

resip::NameAddr::defineParam ( privacy  ,
"privacy"  ,
DataParameter  ,
"RFC 5806"   
)

◆ defineParam() [21/32]

resip::NameAddr::defineParam ( pubGruu  ,
"pub-gruu"  ,
QuotedDataParameter  ,
"RFC 5627"   
)

◆ defineParam() [22/32]

resip::NameAddr::defineParam ( q  ,
"q"  ,
QValueParameter  ,
"RFC 3261"   
)

◆ defineParam() [23/32]

resip::NameAddr::defineParam ( rc  ,
"rc"  ,
DataParameter  ,
"RFC 4244-bis"   
)

◆ defineParam() [24/32]

resip::NameAddr::defineParam ( reason  ,
"reason"  ,
DataParameter  ,
"RFC 5806"   
)

◆ defineParam() [25/32]

resip::NameAddr::defineParam ( regid  ,
"reg-id"  ,
UInt32Parameter  ,
"RFC 5626"   
)

◆ defineParam() [26/32]

resip::NameAddr::defineParam ( schemes  ,
"schemes"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [27/32]

resip::NameAddr::defineParam ( screen  ,
"screen"  ,
DataParameter  ,
"RFC 5806"   
)

◆ defineParam() [28/32]

resip::NameAddr::defineParam ( tag  ,
"tag"  ,
DataParameter  ,
"RFC 3261"   
)

◆ defineParam() [29/32]

resip::NameAddr::defineParam ( tempGruu  ,
"temp-gruu"  ,
QuotedDataParameter  ,
"RFC 5627"   
)

◆ defineParam() [30/32]

resip::NameAddr::defineParam ( text  ,
"text"  ,
ExistsOrDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [31/32]

resip::NameAddr::defineParam ( type  ,
"type"  ,
QuotedDataParameter  ,
"RFC 3840"   
)

◆ defineParam() [32/32]

resip::NameAddr::defineParam ( video  ,
"video"  ,
ExistsParameter  ,
"RFC 3840"   
)

◆ displayName() [1/2]

Data & NameAddr::displayName ( )

Definition at line 144 of file NameAddr.cxx.

◆ displayName() [2/2]

const Data & NameAddr::displayName ( ) const

Definition at line 151 of file NameAddr.cxx.

◆ encodeParsed()

EncodeStream & NameAddr::encodeParsed ( EncodeStream &  str) const
virtual

Implements resip::LazyParser.

Definition at line 291 of file NameAddr.cxx.

◆ exists() [1/3]

bool ParserCategory::exists ( const ExtensionParameter &  param) const

Checks for the existence of a non-natively-supported parameter.

Parameters
paramThe runtime constructed accessor token.
Returns
true iff the parameter is present.

Definition at line 187 of file ParserCategory.cxx.

◆ exists() [2/3]

bool NameAddr::exists ( const Param< NameAddr > &  paramType) const

Definition at line 477 of file NameAddr.cxx.

◆ exists() [3/3]

bool resip::ParserCategory::exists ( const ParamBase &  paramType) const
inline

Checks for the existence of a natively supported parameter.

Parameters
paramTypeThe accessor token for the parameter.
Returns
true iff the parameter is present.

Definition at line 145 of file ParserCategory.hxx.

◆ isAllContacts()

bool NameAddr::isAllContacts ( ) const

Definition at line 158 of file NameAddr.cxx.

◆ mustQuoteDisplayName()

bool NameAddr::mustQuoteDisplayName ( ) const
protected

Definition at line 341 of file NameAddr.cxx.

◆ operator<()

bool NameAddr::operator< ( const NameAddr &  other) const

Definition at line 105 of file NameAddr.cxx.

◆ operator=()

NameAddr & NameAddr::operator= ( const NameAddr &  rhs)

Definition at line 83 of file NameAddr.cxx.

◆ operator==()

bool NameAddr::operator== ( const NameAddr &  other) const

Definition at line 98 of file NameAddr.cxx.

◆ param() [1/2]

Data & ParserCategory::param ( const ExtensionParameter &  param)

Accessor for non-natively-supported parameter types.

Will create the parameter if it does not exist.

Parameters
paramThe runtime constructed parameter accessor.
Returns
The parameter, as a raw Data.

Definition at line 173 of file ParserCategory.cxx.

◆ param() [2/2]

const Data & ParserCategory::param ( const ExtensionParameter &  param) const

Const accessor for non-natively-supported parameter types.

Exceptions
ParserCategory::Exceptionif this parameter doesn't exist.
Parameters
paramThe runtime constructed parameter accessor.
Returns
The parameter, as a raw Data.

Definition at line 165 of file ParserCategory.cxx.

◆ parse()

void NameAddr::parse ( ParseBuffer &  pb)
virtual

Implements resip::LazyParser.

Definition at line 171 of file NameAddr.cxx.

◆ remove() [1/3]

void ParserCategory::remove ( const ExtensionParameter &  param)

Removes a non-natively-supported parameter, if the parameter is present.

Parameters
paramThe accessor token for the parameter.

Definition at line 180 of file ParserCategory.cxx.

◆ remove() [2/3]

void NameAddr::remove ( const Param< NameAddr > &  paramType)

Definition at line 485 of file NameAddr.cxx.

◆ remove() [3/3]

void ParserCategory::remove ( const ParamBase &  paramType)

Removes a natively supported parameter, if the parameter is present.

Parameters
paramTypeThe accessor token for the parameter.

Definition at line 156 of file ParserCategory.cxx.

◆ setAllContacts()

void NameAddr::setAllContacts ( )

Definition at line 165 of file NameAddr.cxx.

◆ uri() [1/2]

Uri & NameAddr::uri ( )

Definition at line 137 of file NameAddr.cxx.

◆ uri() [2/2]

const Uri & NameAddr::uri ( ) const

Definition at line 130 of file NameAddr.cxx.

Member Data Documentation

◆ commaHandling

constexpr CommaHandlingMode resip::NameAddr::commaHandling = CommasAllowedOutputMulti
staticconstexpr

Definition at line 21 of file NameAddr.hxx.

◆ mAllContacts

bool resip::NameAddr::mAllContacts
protected

Definition at line 107 of file NameAddr.hxx.

◆ mDisplayName

Data resip::NameAddr::mDisplayName
protected

Definition at line 109 of file NameAddr.hxx.

◆ mUnknownUriParametersBuffer

Data* resip::NameAddr::mUnknownUriParametersBuffer
protected

Definition at line 110 of file NameAddr.hxx.

◆ mUri

Uri resip::NameAddr::mUri
protected

Definition at line 108 of file NameAddr.hxx.


The documentation for this class was generated from the following files: