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

Represents the "media-type" element in the RFC 3261 grammar. More...

#include <Mime.hxx>

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

List of all members.

Public Types

enum  { commaHandling = CommasAllowedOutputCommas }

Public Member Functions

 Mime ()
 Mime (const Data &type, const Data &subType)
 Mime (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0)
 Mime (const Mime &orig, PoolBase *pool=0)
Mimeoperator= (const Mime &)
bool operator< (const Mime &rhs) const
bool isEqual (const Mime &rhs) const
bool operator== (const Mime &rhs) const
bool operator!= (const Mime &rhs) const
const Datatype () const
const DatasubType () const
Datatype ()
DatasubType ()
virtual void parse (ParseBuffer &pb)
virtual ParserCategoryclone () const
virtual ParserCategoryclone (void *location) const
virtual ParserCategoryclone (PoolBase *pool) const
virtual EncodeStreamencodeParsed (EncodeStream &str) const
virtual ParametercreateParam (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
bool exists (const Param< Mime > &paramType) const
void remove (const Param< Mime > &paramType)
 defineParam (accessType,"access-type", DataParameter,"RFC 2046")
 defineParam (boundary,"boundary", DataParameter,"RFC 2046")
 defineParam (charset,"charset", DataParameter,"RFC 2045")
 defineParam (directory,"directory", DataParameter,"RFC 2046")
 defineParam (expiration,"expiration", QuotedDataParameter,"RFC 2046")
 defineParam (micalg,"micalg", DataParameter,"RFC 1847")
 defineParam (mode,"mode", DataParameter,"RFC 2046")
 defineParam (name,"name", DataParameter,"RFC 2046")
 defineParam (permission,"permission", DataParameter,"RFC 2046")
 defineParam (protocol,"protocol", QuotedDataParameter,"RFC 1847")
 defineParam (q,"q", QValueParameter,"RFC 3261")
 defineParam (server,"server", DataParameter,"RFC 2046")
 defineParam (site,"site", DataParameter,"RFC 2046")
 defineParam (size,"size", DataParameter,"RFC 2046")
 defineParam (smimeType,"smime-type", DataParameter,"RFC 2633")
 defineParam (url,"url", QuotedDataParameter,"RFC 4483")

Private Attributes

Data mType
Data mSubType

Static Private Attributes

static ParameterTypes::Factory ParameterFactories [ParameterTypes::MAX_PARAMETER] = {0}

Detailed Description

Represents the "media-type" element in the RFC 3261 grammar.

Definition at line 19 of file Mime.hxx.


Member Enumeration Documentation

anonymous enum
Enumerator:
commaHandling 

Definition at line 22 of file Mime.hxx.


Constructor & Destructor Documentation

Mime::Mime ( )

Definition at line 20 of file Mime.cxx.

Referenced by clone().

Mime::Mime ( const Data type,
const Data subType 
)

Definition at line 26 of file Mime.cxx.

   : ParserCategory(), 
     mType(type), 
     mSubType(subType) 
{}
Mime::Mime ( const HeaderFieldValue hfv,
Headers::Type  type,
PoolBase pool = 0 
)

Definition at line 32 of file Mime.cxx.

   : ParserCategory(hfv, type, pool),
     mType(), 
     mSubType()
{}
Mime::Mime ( const Mime orig,
PoolBase pool = 0 
)

Definition at line 40 of file Mime.cxx.

   : ParserCategory(rhs, pool),
     mType(rhs.mType),
     mSubType(rhs.mSubType)
{}

Member Function Documentation

ParserCategory * Mime::clone ( ) const [virtual]

Implements resip::ParserCategory.

Definition at line 140 of file Mime.cxx.

References Mime().

{
   return new Mime(*this);
}

Here is the call graph for this function:

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

Implements resip::ParserCategory.

Definition at line 146 of file Mime.cxx.

References Mime().

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

Here is the call graph for this function:

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

Implements resip::ParserCategory.

Definition at line 152 of file Mime.cxx.

References Mime().

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

Here is the call graph for this function:

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

Reimplemented from resip::ParserCategory.

Definition at line 168 of file Mime.cxx.

References resip::ParameterTypes::MAX_PARAMETER, ParameterFactories, type(), and resip::ParameterTypes::UNKNOWN.

{
   if(type > ParameterTypes::UNKNOWN && type < ParameterTypes::MAX_PARAMETER && ParameterFactories[type])
   {
      return ParameterFactories[type](type, pb, terminators, pool);
   }
   return 0;
}

Here is the call graph for this function:

resip::Mime::defineParam ( accessType  ,
"access-type"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( boundary  ,
"boundary"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( charset  ,
"charset"  ,
DataParameter  ,
"RFC 2045"   
)
resip::Mime::defineParam ( directory  ,
"directory"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( expiration  ,
"expiration"  ,
QuotedDataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( micalg  ,
"micalg"  ,
DataParameter  ,
"RFC 1847"   
)
resip::Mime::defineParam ( mode  ,
"mode"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( name  ,
"name"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( permission  ,
"permission"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( protocol  ,
"protocol"  ,
QuotedDataParameter  ,
"RFC 1847"   
)
resip::Mime::defineParam ( ,
"q"  ,
QValueParameter  ,
"RFC 3261"   
)
resip::Mime::defineParam ( server  ,
"server"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( site  ,
"site"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( size  ,
"size"  ,
DataParameter  ,
"RFC 2046"   
)
resip::Mime::defineParam ( smimeType  ,
"smime-type"  ,
DataParameter  ,
"RFC 2633"   
)
resip::Mime::defineParam ( url  ,
"url"  ,
QuotedDataParameter  ,
"RFC 4483"   
)
EncodeStream & Mime::encodeParsed ( EncodeStream str) const [virtual]

Implements resip::LazyParser.

Definition at line 158 of file Mime.cxx.

References resip::ParserCategory::encodeParameters(), mSubType, mType, and resip::Symbols::SLASH.

{
   str << mType << Symbols::SLASH << mSubType ;
   encodeParameters(str);
   return str;
}

Here is the call graph for this function:

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

Definition at line 178 of file Mime.cxx.

References resip::LazyParser::checkParsed(), resip::ParserCategory::getParameterByEnum(), and resip::ParamBase::getTypeNum().

Referenced by findRlmi(), and resip::MultipartMixedContents::MultipartMixedContents().

{
    checkParsed();
    bool ret = getParameterByEnum(paramType.getTypeNum()) != NULL;
    return ret;
}

Here is the call graph for this function:

bool Mime::isEqual ( const Mime rhs) const

Definition at line 74 of file Mime.cxx.

References resip::isEqualNoCase(), subType(), and type().

{
   return (isEqualNoCase(type(), rhs.type()) &&
           isEqualNoCase(subType(), rhs.subType()));
}

Here is the call graph for this function:

bool Mime::operator!= ( const Mime rhs) const

Definition at line 88 of file Mime.cxx.

{
   return !(*this == rhs);
}
bool Mime::operator< ( const Mime rhs) const

Definition at line 60 of file Mime.cxx.

References resip::isLessThanNoCase(), subType(), and type().

{
   if (isLessThanNoCase(type(), rhs.type()))
   {
      return true;
   }
   else if (isLessThanNoCase(rhs.type(), type()))
   {
      return false;
   }
   return isLessThanNoCase(subType(), rhs.subType());
}

Here is the call graph for this function:

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

Definition at line 48 of file Mime.cxx.

References mSubType, and mType.

{
   if (this != &rhs)
   {
      ParserCategory::operator=(rhs);
      mType = rhs.mType;
      mSubType = rhs.mSubType;
   }
   return *this;
}
bool Mime::operator== ( const Mime rhs) const

Definition at line 81 of file Mime.cxx.

References resip::isEqualNoCase(), subType(), and type().

{
   return (isEqualNoCase(type(), rhs.type()) &&
           isEqualNoCase(subType(), rhs.subType()));
}

Here is the call graph for this function:

void Mime::parse ( ParseBuffer pb) [virtual]

Implements resip::LazyParser.

Definition at line 120 of file Mime.cxx.

References resip::ParseBuffer::data(), mSubType, mType, resip::ParserCategory::parseParameters(), resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipToOneOf(), resip::ParseBuffer::skipWhitespace(), resip::Symbols::SLASH, and resip::Data::toBitset().

Referenced by main(), and resip::MultipartMixedContents::parse().

{
   const char* anchor = pb.skipWhitespace();
   static std::bitset<256> delimiter1=Data::toBitset("\r\n\t /");
   pb.skipToOneOf(delimiter1);
   pb.data(mType, anchor);

   pb.skipWhitespace();
   pb.skipChar(Symbols::SLASH[0]);

   anchor = pb.skipWhitespace();
   static std::bitset<256> delimiter2=Data::toBitset("\r\n\t ;");
   pb.skipToOneOf(delimiter2);
   pb.data(mSubType, anchor);

   pb.skipWhitespace();
   parseParameters(pb);
}

Here is the call graph for this function:

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

Definition at line 186 of file Mime.cxx.

References resip::LazyParser::checkParsed(), resip::ParamBase::getTypeNum(), and resip::ParserCategory::removeParameterByEnum().

Here is the call graph for this function:

const Data & Mime::subType ( ) const

Definition at line 100 of file Mime.cxx.

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

Referenced by isEqual(), main(), operator<(), operator==(), resip::TuIM::processMessageRequest(), resip::TuIM::processNotifyRequest(), and resip::TuIM::processSipFrag().

{
   checkParsed(); 
   return mSubType;
}

Here is the call graph for this function:

Data & Mime::subType ( )

Definition at line 113 of file Mime.cxx.

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

{
   checkParsed(); 
   return mSubType;
}

Here is the call graph for this function:

const Data & Mime::type ( ) const

Definition at line 94 of file Mime.cxx.

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

Referenced by createParam(), isEqual(), main(), operator<(), operator==(), resip::TuIM::processMessageRequest(), resip::TuIM::processNotifyRequest(), and resip::TuIM::processSipFrag().

{
   checkParsed(); 
   return mType;
}

Here is the call graph for this function:

Data & Mime::type ( )

Definition at line 107 of file Mime.cxx.

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

{
   checkParsed(); 
   return mType;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 85 of file Mime.hxx.

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

Definition at line 84 of file Mime.hxx.

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

Definition at line 87 of file Mime.hxx.

Referenced by createParam().


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