Yate
IAXIEList Class Reference

Information Element container. More...

#include <yateiax.h>

Public Member Functions

 IAXIEList ()
 
 IAXIEList (const IAXFullFrame *frame, bool incoming=true)
 
 ~IAXIEList ()
 
bool invalidIEList () const
 
void clear ()
 
bool empty ()
 
void insertVersion ()
 
bool validVersion ()
 
void appendIE (IAXInfoElement *ie)
 
bool appendIE (IAXIEList &src, IAXInfoElement::Type type)
 
void appendNull (IAXInfoElement::Type type)
 
void appendString (IAXInfoElement::Type type, const String &src)
 
void appendString (IAXInfoElement::Type type, unsigned char *src, unsigned len)
 
void appendNumeric (IAXInfoElement::Type type, u_int32_t value, u_int8_t len)
 
void appendBinary (IAXInfoElement::Type type, unsigned char *data, unsigned len)
 
bool createFromFrame (const IAXFullFrame *frame, bool incoming=true)
 
void toBuffer (DataBlock &buf)
 
void toString (String &dest, const char *indent=0)
 
IAXInfoElementgetIE (IAXInfoElement::Type type, bool remove=false)
 
bool getString (IAXInfoElement::Type type, String &dest)
 
bool getNumeric (IAXInfoElement::Type type, u_int32_t &dest)
 
bool getBinary (IAXInfoElement::Type type, DataBlock &dest)
 

Detailed Description

Information Element container.

Management class for a list of Information Elements

Constructor & Destructor Documentation

◆ IAXIEList() [1/2]

IAXIEList ( )

Constructor

Referenced by appendIE().

◆ IAXIEList() [2/2]

IAXIEList ( const IAXFullFrame * frame,
bool incoming = true )

Constructor. Construct the list from an IAXFullFrame object

Parameters
frameSource object
incomingTrue if it is an incoming frame

◆ ~IAXIEList()

~IAXIEList ( )

Destructor

Member Function Documentation

◆ appendBinary()

void appendBinary ( IAXInfoElement::Type type,
unsigned char * data,
unsigned len )
inline

Append a binary Information Element to the list

Parameters
typeThe type of the IAXInfoElementBinary to append
dataThe source data to append
lenSource length

◆ appendIE() [1/2]

bool appendIE ( IAXIEList & src,
IAXInfoElement::Type type )
inline

Append an Information Element taken from another list

Parameters
srcSource IE list
typeIE to move
Returns
True if found and added

References appendIE(), getIE(), and IAXIEList().

◆ appendIE() [2/2]

void appendIE ( IAXInfoElement * ie)
inline

Append an Information Element to the list

Parameters
ieIAXInfoElement pointer to append

Referenced by appendIE().

◆ appendNull()

void appendNull ( IAXInfoElement::Type type)
inline

Append an Information Element to the list

Parameters
typeThe type of the IAXInfoElement to append

◆ appendNumeric()

void appendNumeric ( IAXInfoElement::Type type,
u_int32_t value,
u_int8_t len )
inline

Append a numeric Information Element to the list

Parameters
typeThe type of the IAXInfoElementNumeric to append
valueThe source
lenSource length

◆ appendString() [1/2]

void appendString ( IAXInfoElement::Type type,
const String & src )
inline

Append a text Information Element to the list from a String

Parameters
typeThe type of the IAXInfoElementString to append
srcThe source

References String::c_str(), and String::length().

◆ appendString() [2/2]

void appendString ( IAXInfoElement::Type type,
unsigned char * src,
unsigned len )
inline

Append a text Information Element to the list from a buffer

Parameters
typeThe type of the IAXInfoElementString to append
srcThe source
lenSource length

◆ clear()

void clear ( )
inline

Clear the list

◆ createFromFrame()

bool createFromFrame ( const IAXFullFrame * frame,
bool incoming = true )

Construct the list from an IAXFullFrame object. On exit m_invalidIEList will contain the opposite of the returned value

Parameters
frameSource object
incomingTrue if it is an incoming frame
Returns
False if the frame contains invalid IEs

◆ empty()

bool empty ( )
inline

Check if the list is empty

Returns
True if the list is empty

◆ getBinary()

bool getBinary ( IAXInfoElement::Type type,
DataBlock & dest )

Get the data of a list item into a DataBlock. Before any operation dest is cleared

Parameters
typeThe desired type
destThe destination buffer
Returns
False if the list doesn't contain an IE of this type

◆ getIE()

IAXInfoElement * getIE ( IAXInfoElement::Type type,
bool remove = false )

Retrieve an IAXInfoElement from the list

Parameters
typeThe desired type
removeTrue to remove from list. The caller will own the object
Returns
An IAXInfoElement pointer or 0 if the list doesn't contain an IE of this type

Referenced by appendIE().

◆ getNumeric()

bool getNumeric ( IAXInfoElement::Type type,
u_int32_t & dest )

Get the data of a list item into a numeric destination

Parameters
typeThe desired type
destThe destination
Returns
False if the list doesn't contain an IE of this type

Referenced by validVersion().

◆ getString()

bool getString ( IAXInfoElement::Type type,
String & dest )

Get the data of a list item into a String. Before any operation dest is cleared

Parameters
typeThe desired type
destThe destination String
Returns
False if the list doesn't contain an IE of this type

◆ insertVersion()

void insertVersion ( )

Insert a VERSION Information Element in the list if not already done

◆ invalidIEList()

bool invalidIEList ( ) const
inline

Get the invalid IE list flag

Returns
False if the last frame parse was unsuccessful

◆ toBuffer()

void toBuffer ( DataBlock & buf)

Construct a buffer from this list

Parameters
bufDestination buffer

◆ toString()

void toString ( String & dest,
const char * indent = 0 )

Add this list to a string

Parameters
destDestination string
indentOptional indent for each element

◆ validVersion()

bool validVersion ( )
inline

Get the validity of the VERSION Information Element of the list if any

Returns
False if version is not IAX_PROTOCOL_VERSION or the list doesn't contain a VERSION Information Element

References getNumeric().


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