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

Generically used to represent any parameter that is not known by the implmentation. More...

#include <UnknownParameter.hxx>

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

List of all members.

Public Member Functions

 UnknownParameter (const char *startName, unsigned int nameSize, ParseBuffer &pb, const std::bitset< 256 > &terminators)
 UnknownParameter (ParameterTypes::Type type, const Data &value)
 UnknownParameter (const Data &name)
EncodeStreamencode (EncodeStream &stream) const
Datavalue ()
const Datavalue () const
bool hasValue () const
bool isQuoted () const
void setQuoted (bool b)
virtual const DatagetName () const
virtual Parameterclone () const

Private Attributes

Data mName
Data mValue
bool mIsQuoted

Detailed Description

Generically used to represent any parameter that is not known by the implmentation.

Definition at line 18 of file UnknownParameter.hxx.


Constructor & Destructor Documentation

UnknownParameter::UnknownParameter ( const char *  startName,
unsigned int  nameSize,
ParseBuffer pb,
const std::bitset< 256 > &  terminators 
)

Definition at line 13 of file UnknownParameter.cxx.

References resip::ParseBuffer::data(), resip::Symbols::DOUBLE_QUOTE, resip::ParseBuffer::eof(), resip::Symbols::EQUALS, mValue, resip::ParseBuffer::position(), setQuoted(), resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipToEndQuote(), resip::ParseBuffer::skipToOneOf(), and resip::ParseBuffer::skipWhitespace().

Referenced by clone().

   : Parameter(ParameterTypes::UNKNOWN),
     mName(startName, nameSize),
     mValue(),
     mIsQuoted(false)
{
   pb.skipWhitespace();
   if (!pb.eof() && *pb.position() == Symbols::EQUALS[0])
   {
      pb.skipChar(Symbols::EQUALS[0]);
      pb.skipWhitespace();
      if (*pb.position() == Symbols::DOUBLE_QUOTE[0])
      {
         setQuoted(true);
         pb.skipChar();
         const char* pos = pb.position();
         pb.skipToEndQuote();
         pb.data(mValue, pos);
         pb.skipChar();
      }
      else
      {
         const char* pos = pb.position();
         pb.skipToOneOf(terminators);
         pb.data(mValue, pos);
      }
      
   }
   else
   {
      // must be a terminator -- exists style
   }
}

Here is the call graph for this function:

resip::UnknownParameter::UnknownParameter ( ParameterTypes::Type  type,
const Data value 
)
UnknownParameter::UnknownParameter ( const Data name) [explicit]

Definition at line 50 of file UnknownParameter.cxx.


Member Function Documentation

Parameter * UnknownParameter::clone ( ) const [virtual]

Implements resip::Parameter.

Definition at line 65 of file UnknownParameter.cxx.

References UnknownParameter().

{
   return new UnknownParameter(*this);
}

Here is the call graph for this function:

EncodeStream & UnknownParameter::encode ( EncodeStream stream) const [virtual]

Implements resip::Parameter.

Definition at line 71 of file UnknownParameter.cxx.

References resip::Symbols::DOUBLE_QUOTE, resip::Data::empty(), resip::Symbols::EQUALS, getName(), mIsQuoted, and mValue.

{
   if (mIsQuoted)
   {
      return stream << getName() << Symbols::EQUALS 
                    << Symbols::DOUBLE_QUOTE << mValue << Symbols::DOUBLE_QUOTE;
   }
   else if (!mValue.empty())
   {
      return stream << getName() << Symbols::EQUALS << mValue;
   }
   else
   {
      return stream << getName();
   }
}

Here is the call graph for this function:

const Data & UnknownParameter::getName ( ) const [virtual]

Reimplemented from resip::Parameter.

Definition at line 58 of file UnknownParameter.cxx.

References mName.

Referenced by resip::ParserCategory::commutativeParameterHash(), encode(), and operator<<().

{
   return mName;
}
bool resip::UnknownParameter::hasValue ( ) const [inline]

Definition at line 35 of file UnknownParameter.hxx.

References resip::Data::empty(), mIsQuoted, and mValue.

{return !mValue.empty() || mIsQuoted;}

Here is the call graph for this function:

bool resip::UnknownParameter::isQuoted ( ) const [inline, virtual]

Reimplemented from resip::Parameter.

Definition at line 36 of file UnknownParameter.hxx.

References mIsQuoted.

{ return mIsQuoted; }
void resip::UnknownParameter::setQuoted ( bool  b) [inline, virtual]

Reimplemented from resip::Parameter.

Definition at line 37 of file UnknownParameter.hxx.

References mIsQuoted.

Referenced by UnknownParameter().

{ mIsQuoted = b; }; // this parameter will be enclosed in quotes e.g. "foo"
Data& resip::UnknownParameter::value ( ) [inline]
const Data& resip::UnknownParameter::value ( ) const [inline]

Definition at line 34 of file UnknownParameter.hxx.

References mValue.

{return mValue;}

Member Data Documentation

Definition at line 45 of file UnknownParameter.hxx.

Referenced by encode(), hasValue(), isQuoted(), and setQuoted().

Definition at line 43 of file UnknownParameter.hxx.

Referenced by getName().

Definition at line 44 of file UnknownParameter.hxx.

Referenced by encode(), hasValue(), UnknownParameter(), and value().


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