|
reSIProcate/stack
9694
|
#include <SdpContents.hxx>
Public Member Functions | |
| RESIP_HeapCount (AttributeHelper) | |
| AttributeHelper () | |
| AttributeHelper (const AttributeHelper &rhs) | |
| AttributeHelper & | operator= (const AttributeHelper &rhs) |
| bool | exists (const Data &key) const |
| const std::list< Data > & | getValues (const Data &key) const |
| EncodeStream & | encode (EncodeStream &s) const |
| void | parse (ParseBuffer &pb) |
| void | addAttribute (const Data &key, const Data &value=Data::Empty) |
| void | clearAttribute (const Data &key) |
Private Attributes | |
| std::list< std::pair< Data, Data > > | mAttributeList |
| HashMap< Data, std::list< Data > > | mAttributes |
Definition at line 20 of file SdpContents.hxx.
| AttributeHelper::AttributeHelper | ( | ) |
Definition at line 66 of file SdpContents.cxx.
{
}
| AttributeHelper::AttributeHelper | ( | const AttributeHelper & | rhs | ) |
Definition at line 60 of file SdpContents.cxx.
: mAttributeList(rhs.mAttributeList), mAttributes(rhs.mAttributes) { }
| void AttributeHelper::addAttribute | ( | const Data & | key, |
| const Data & | value = Data::Empty |
||
| ) |
Definition at line 141 of file SdpContents.cxx.
References mAttributeList, and mAttributes.
Referenced by resip::SdpContents::Session::Medium::addAttribute().
{
mAttributeList.push_back(std::make_pair(key, value));
mAttributes[key].push_back(value);
}
| void AttributeHelper::clearAttribute | ( | const Data & | key | ) |
Definition at line 148 of file SdpContents.cxx.
References mAttributeList, and mAttributes.
Referenced by resip::SdpContents::Session::Medium::clearAttribute(), and resip::SdpContents::Session::Medium::codecs().
{
for (std::list<std::pair<Data, Data> >::iterator i = mAttributeList.begin();
i != mAttributeList.end(); )
{
std::list<std::pair<Data, Data> >::iterator j = i++;
if (j->first == key)
{
mAttributeList.erase(j);
}
}
mAttributes.erase(key);
}
| EncodeStream & AttributeHelper::encode | ( | EncodeStream & | s | ) | const |
Definition at line 99 of file SdpContents.cxx.
References resip::Symbols::COLON, CRLF, and mAttributeList.
Referenced by resip::SdpContents::Session::Medium::encode().
{
for (std::list<std::pair<Data, Data> >::const_iterator i = mAttributeList.begin();
i != mAttributeList.end(); ++i)
{
s << "a=" << i->first;
if (!i->second.empty())
{
s << Symbols::COLON[0] << i->second;
}
s << Symbols::CRLF;
}
return s;
}
| bool AttributeHelper::exists | ( | const Data & | key | ) | const |
Definition at line 82 of file SdpContents.cxx.
References mAttributes.
Referenced by resip::SdpContents::Session::Medium::exists(), getValues(), and resip::SdpContents::Session::Medium::getValues().
{
return mAttributes.find(key) != mAttributes.end();
}
Definition at line 88 of file SdpContents.cxx.
References exists(), and mAttributes.
Referenced by resip::SdpContents::Session::Medium::getValues().
{
if (!exists(key))
{
static const list<Data> emptyList;
return emptyList;
}
return mAttributes.find(key)->second;
}

| AttributeHelper & AttributeHelper::operator= | ( | const AttributeHelper & | rhs | ) |
Definition at line 71 of file SdpContents.cxx.
References mAttributeList, and mAttributes.
{
if (this != &rhs)
{
mAttributeList = rhs.mAttributeList;
mAttributes = rhs.mAttributes;
}
return *this;
}
| void AttributeHelper::parse | ( | ParseBuffer & | pb | ) |
Definition at line 115 of file SdpContents.cxx.
References resip::Symbols::COLON, resip::Symbols::CRLF, resip::ParseBuffer::data(), resip::ParseBuffer::eof(), resip::Symbols::EQUALS, mAttributeList, mAttributes, resip::ParseBuffer::position(), resip::ParseBuffer::skipChar(), skipEol(), resip::ParseBuffer::skipToOneOf(), and value.
Referenced by resip::SdpContents::Session::Medium::parse().
{
while (!pb.eof() && *pb.position() == 'a')
{
Data key;
Data value;
pb.skipChar('a');
const char* anchor = pb.skipChar(Symbols::EQUALS[0]);
pb.skipToOneOf(Symbols::COLON, Symbols::CRLF);
pb.data(key, anchor);
if (!pb.eof() && *pb.position() == Symbols::COLON[0])
{
anchor = pb.skipChar(Symbols::COLON[0]);
pb.skipToOneOf(Symbols::CRLF);
pb.data(value, anchor);
}
if(!pb.eof()) skipEol(pb);
mAttributeList.push_back(std::make_pair(key, value));
mAttributes[key].push_back(value);
}
}

| resip::AttributeHelper::RESIP_HeapCount | ( | AttributeHelper | ) |
std::list<std::pair<Data, Data> > resip::AttributeHelper::mAttributeList [private] |
Definition at line 35 of file SdpContents.hxx.
Referenced by addAttribute(), clearAttribute(), encode(), operator=(), and parse().
HashMap< Data, std::list<Data> > resip::AttributeHelper::mAttributes [private] |
Definition at line 36 of file SdpContents.hxx.
Referenced by addAttribute(), clearAttribute(), exists(), getValues(), operator=(), and parse().
1.7.5.1