reSIProcate/stack  9694
Public Types | Public Member Functions | Private Attributes
resip::PrivacyCategory Class Reference

Represents the "token" element in the RFC 3261 grammar. More...

#include <PrivacyCategory.hxx>

Inheritance diagram for resip::PrivacyCategory:
Inheritance graph
[legend]
Collaboration diagram for resip::PrivacyCategory:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { commaHandling = CommasAllowedOutputCommas }

Public Member Functions

 PrivacyCategory ()
 PrivacyCategory (const Data &d)
 PrivacyCategory (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0)
 PrivacyCategory (const PrivacyCategory &orig, PoolBase *pool=0)
PrivacyCategoryoperator= (const PrivacyCategory &)
const std::vector< Data > & value () const
std::vector< Data > & value ()
virtual void parse (ParseBuffer &pb)
virtual ParserCategoryclone () const
virtual ParserCategoryclone (void *location) const
virtual ParserCategoryclone (PoolBase *pool) const
virtual EncodeStreamencodeParsed (EncodeStream &str) const

Private Attributes

std::vector< DatamValue

Detailed Description

Represents the "token" element in the RFC 3261 grammar.

Definition at line 17 of file PrivacyCategory.hxx.


Member Enumeration Documentation

anonymous enum
Enumerator:
commaHandling 

Definition at line 20 of file PrivacyCategory.hxx.


Constructor & Destructor Documentation

resip::PrivacyCategory::PrivacyCategory ( )

Definition at line 7 of file PrivacyCategory.cxx.

Referenced by clone().

resip::PrivacyCategory::PrivacyCategory ( const Data d) [explicit]

Definition at line 13 of file PrivacyCategory.cxx.

References resip::Data::data(), resip::Data::size(), and resip::Headers::UNKNOWN.

   : ParserCategory(),
     mValue() 
{
   HeaderFieldValue hfv(d.data(), d.size());
   PrivacyCategory tmp(hfv, Headers::UNKNOWN);
   tmp.checkParsed();
   *this = tmp;
}

Here is the call graph for this function:

resip::PrivacyCategory::PrivacyCategory ( const HeaderFieldValue hfv,
Headers::Type  type,
PoolBase pool = 0 
)

Definition at line 23 of file PrivacyCategory.cxx.

   : ParserCategory(hfv, type, pool), 
     mValue() 
{}
resip::PrivacyCategory::PrivacyCategory ( const PrivacyCategory orig,
PoolBase pool = 0 
)

Definition at line 30 of file PrivacyCategory.cxx.

   : ParserCategory(rhs, pool),
     mValue(rhs.mValue)
{}

Member Function Documentation

ParserCategory * resip::PrivacyCategory::clone ( ) const [virtual]

Implements resip::ParserCategory.

Definition at line 88 of file PrivacyCategory.cxx.

References PrivacyCategory().

{
   return new PrivacyCategory(*this);
}

Here is the call graph for this function:

ParserCategory * resip::PrivacyCategory::clone ( void *  location) const [virtual]

Implements resip::ParserCategory.

Definition at line 94 of file PrivacyCategory.cxx.

References PrivacyCategory().

{
   return new (location) PrivacyCategory(*this);
}

Here is the call graph for this function:

ParserCategory * resip::PrivacyCategory::clone ( PoolBase pool) const [virtual]

Implements resip::ParserCategory.

Definition at line 100 of file PrivacyCategory.cxx.

References PrivacyCategory().

{
   return new (pool) PrivacyCategory(*this, pool);
}

Here is the call graph for this function:

EncodeStream & resip::PrivacyCategory::encodeParsed ( EncodeStream str) const [virtual]

Implements resip::LazyParser.

Definition at line 106 of file PrivacyCategory.cxx.

References mValue.

{
   bool first=true;
   for(std::vector<Data>::const_iterator i=mValue.begin(); i!=mValue.end(); ++i)
   {
      if(first)
      {
         first=false;
      }
      else
      {
         str << ';';
      }
      str << *i;
   }
   return str;
}
PrivacyCategory & resip::PrivacyCategory::operator= ( const PrivacyCategory rhs)

Definition at line 37 of file PrivacyCategory.cxx.

References mValue.

{
   if (this != &rhs)
   {
      ParserCategory::operator=(rhs);
      mValue = rhs.mValue;
   }
   return *this;
}
void resip::PrivacyCategory::parse ( ParseBuffer pb) [virtual]

Implements resip::LazyParser.

Definition at line 62 of file PrivacyCategory.cxx.

References resip::ParseBuffer::data(), resip::ParseBuffer::eof(), mValue, resip::ParseBuffer::position(), resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipToOneOf(), resip::ParseBuffer::skipWhitespace(), and resip::ParseBuffer::Whitespace.

{
   while(!pb.eof())
   {
      pb.skipWhitespace();
      if(!pb.eof())
      {
         const char* start=pb.position();
         pb.skipToOneOf(";",ParseBuffer::Whitespace);
         if(pb.position()==start)
         {
            throw ParseException("Empty privacy token!",
                                 "PrivacyCategory::parse()",
                                 __FILE__, __LINE__);
         }
         mValue.push_back(pb.data(start));
         pb.skipWhitespace();
      }
      if(!pb.eof())
      {
         pb.skipChar(';');
      }
   }
}

Here is the call graph for this function:

const std::vector< Data > & resip::PrivacyCategory::value ( ) const

Definition at line 48 of file PrivacyCategory.cxx.

References resip::LazyParser::checkParsed(), and mValue.

{
   checkParsed();
   return mValue;
}

Here is the call graph for this function:

std::vector< Data > & resip::PrivacyCategory::value ( )

Definition at line 55 of file PrivacyCategory.cxx.

References resip::LazyParser::checkParsed(), and mValue.

{
   checkParsed();
   return mValue;
}

Here is the call graph for this function:


Member Data Documentation

std::vector<Data> resip::PrivacyCategory::mValue [private]

Definition at line 40 of file PrivacyCategory.hxx.

Referenced by encodeParsed(), operator=(), parse(), and value().


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