reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::Contents Class Referenceabstract

Base class for all SIP body types. More...

#include <Contents.hxx>

Inheritance diagram for resip::Contents:
[legend]

Public Member Functions

 Contents (const HeaderFieldValue &headerFieldValue, const Mime &contentsType)
 pass Mime instance for parameters
 
 Contents (const Mime &contentsType)
 Create a contents with a given mime type.
 
 Contents (const Contents &rhs)
 Copy constructor.
 
 Contents (const Contents &rhs, HeaderFieldValue::CopyPaddingEnum e)
 
 Contents (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e, const Mime &contentsType)
 
virtual ~Contents ()
 
Contents & operator= (const Contents &rhs)
 Assignment operator.
 
void preParseHeaders (ParseBuffer &pb)
 Preforms preparsing on the headers stored in the ParseBuffer pb.
 
EncodeStream & encodeHeaders (EncodeStream &str) const
 encodes headers to an output stream
 
virtual Contents * getContents ()
 access to wrapped contents (signed, encrypted)
 
Contents * getContents (const Mime &)
 
virtual Data getBodyData () const
 
virtual Contents * clone () const =0
 returns a copy of a Contents object
 
const Mime & getType () const
 getter for mime type of message
 
bool exists (const HeaderBase &headerType) const
 checks to see if a header is present
 
void remove (const HeaderBase &headerType)
 removes a header if it is present
 
bool exists (const MIME_Header &headerType) const
 checks to see if a MIME header exists
 
void remove (const MIME_Header &headerType)
 removes a MIME header if it is present
 
const H_ContentType::Type & header (const H_ContentType &headerType) const
 returns the value of the Content-Type header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentType::Type & header (const H_ContentType &headerType)
 returns the value of the Content-Type header
 
const H_ContentDisposition::Type & header (const H_ContentDisposition &headerType) const
 returns the value of the Content-Disposition header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentDisposition::Type & header (const H_ContentDisposition &headerType)
 returns the value of the Content-Disposition header
 
const H_ContentTransferEncoding::Type & header (const H_ContentTransferEncoding &headerType) const
 returns the value of the Content-Transfer-Encoding header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentTransferEncoding::Type & header (const H_ContentTransferEncoding &headerType)
 returns the value of the Content-Transfer-Encoding header
 
const H_ContentLanguages::Type & header (const H_ContentLanguages &headerType) const
 returns the value of the Content-Languages header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentLanguages::Type & header (const H_ContentLanguages &headerType)
 returns the value of the Content-Languages header
 
const H_ContentID::Type & header (const H_ContentID &headerType) const
 returns the value of the Content-ID MIME header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentID::Type & header (const H_ContentID &headerType)
 returns the value of the Content-ID MIME header
 
const H_ContentDescription::Type & header (const H_ContentDescription &headerType) const
 returns the Content-Description MIME header Throws an Contents::Exception if the header doesn't exist.
 
H_ContentDescription::Type & header (const H_ContentDescription &headerType)
 returns the Content-Description MIME header
 
int & version ()
 returns the major version of MIME used by the contents
 
int & minorVersion ()
 returns the minor version of MIME used by the contents
 
void addBuffer (char *buf)
 
- Public Member Functions inherited from resip::LazyParser
 LazyParser (const HeaderFieldValue &headerFieldValue)
 
 LazyParser (const char *buf, int length)
 
 LazyParser (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e)
 
 LazyParser (const LazyParser &rhs)
 
 LazyParser (const LazyParser &rhs, HeaderFieldValue::CopyPaddingEnum e)
 
LazyParser & operator= (const LazyParser &rhs)
 
virtual ~LazyParser ()
 
virtual EncodeStream & encodeParsed (EncodeStream &str) const =0
 
virtual void parse (ParseBuffer &pb)=0
 
EncodeStream & encode (EncodeStream &str) const
 Encodes this element to a stream, in the fashion it should be represented on the wire.
 
bool isParsed () const
 Returns true iff a parse has been attempted.
 
HeaderFieldValue & getHeaderField ()
 
void checkParsed () const
 
void checkParsed ()
 
void doParse () const
 
void markDirty () const
 
bool isWellFormed () const
 Returns true iff this element was parsed successfully, according to the implementation of parse().
 

Static Public Member Functions

static Contents * createContents (const Mime &contentType, const Data &contents)
 factory method to create a Contents object from a mime type and a payload
 

Protected Member Functions

void clear ()
 
void init ()
 
void init (const Contents &orig)
 
void freeMem ()
 
virtual const Data & errorContext () const
 
- Protected Member Functions inherited from resip::LazyParser
 LazyParser ()
 
void clear ()
 

Protected Attributes

Mime mType
 
H_ContentDisposition::Type * mDisposition
 
H_ContentTransferEncoding::Type * mTransferEncoding
 
H_ContentLanguages::Type * mLanguages
 
Token * mId
 
H_ContentDescription::Type * mDescription
 
StringCategory * mLength
 
int mVersion
 
int mMinorVersion
 
std::vector< char * > mBufferList
 

Detailed Description

Base class for all SIP body types.

Lazily-parsed.

Definition at line 50 of file Contents.hxx.

Constructor & Destructor Documentation

◆ Contents() [1/5]

Contents::Contents ( const HeaderFieldValue &  headerFieldValue,
const Mime &  contentsType 
)

pass Mime instance for parameters

Definition at line 22 of file Contents.cxx.

◆ Contents() [2/5]

Contents::Contents ( const Mime &  contentsType)

Create a contents with a given mime type.

Parameters
contentsTypethe mime type of the contents

Definition at line 30 of file Contents.cxx.

◆ Contents() [3/5]

Contents::Contents ( const Contents &  rhs)

Copy constructor.

Parameters
rhsthe Contents to be copied

Definition at line 36 of file Contents.cxx.

◆ Contents() [4/5]

Contents::Contents ( const Contents &  rhs,
HeaderFieldValue::CopyPaddingEnum  e 
)

Definition at line 42 of file Contents.cxx.

◆ Contents() [5/5]

Contents::Contents ( const HeaderFieldValue &  headerFieldValue,
HeaderFieldValue::CopyPaddingEnum  e,
const Mime &  contentsType 
)

Definition at line 48 of file Contents.cxx.

◆ ~Contents()

Contents::~Contents ( )
virtual

Definition at line 58 of file Contents.cxx.

Member Function Documentation

◆ addBuffer()

void Contents::addBuffer ( char *  buf)

Definition at line 668 of file Contents.cxx.

◆ clear()

void resip::Contents::clear ( )
inlineprotected

Definition at line 294 of file Contents.hxx.

◆ clone()

◆ createContents()

Contents * Contents::createContents ( const Mime &  contentType,
const Data &  contents 
)
static

factory method to create a Contents object from a mime type and a payload

Parameters
contentTypethe mime type of the contents
contentsthe contents
Returns
a instance of a Contents subclass appropriate to the mime type
Note
If no registered Contents subclass has been registered with the factory an instance of OctetContents is returned.
See also
ContentsFactory
ContentsFactoryBase

Definition at line 148 of file Contents.cxx.

◆ encodeHeaders()

EncodeStream & Contents::encodeHeaders ( EncodeStream &  str) const

encodes headers to an output stream

Parameters
stroutput stream destination for encoded headers
Returns
a reference to str

Definition at line 588 of file Contents.cxx.

◆ errorContext()

const Data & Contents::errorContext ( ) const
protectedvirtual

Implements resip::LazyParser.

Definition at line 65 of file Contents.cxx.

◆ exists() [1/2]

bool Contents::exists ( const HeaderBase &  headerType) const

checks to see if a header is present

Parameters
headerTypethe header to check for
Returns
true if that header exists and false otherwise

Definition at line 189 of file Contents.cxx.

◆ exists() [2/2]

bool Contents::exists ( const MIME_Header &  headerType) const

checks to see if a MIME header exists

Parameters
headerTypethe MIME header to check for
Returns
true if the header exists and false otherwise

Definition at line 215 of file Contents.cxx.

◆ freeMem()

void resip::Contents::freeMem ( )
inlineprotected

Definition at line 322 of file Contents.hxx.

◆ getBodyData()

Data Contents::getBodyData ( ) const
virtual

Definition at line 661 of file Contents.cxx.

◆ getContents() [1/2]

virtual Contents * resip::Contents::getContents ( )
inlinevirtual

access to wrapped contents (signed, encrypted)

Returns
a pointer to self

Definition at line 100 of file Contents.hxx.

◆ getContents() [2/2]

Contents * resip::Contents::getContents ( const Mime &  )

◆ getType()

const Mime & resip::Contents::getType ( ) const
inline

getter for mime type of message

Returns
the mime type of the message

Definition at line 118 of file Contents.hxx.

◆ header() [1/12]

H_ContentDescription::Type & Contents::header ( const H_ContentDescription &  headerType)

returns the Content-Description MIME header

retval = contents.header(Headers::ContentDescription)
Returns
the Content-Description MIME header

Definition at line 409 of file Contents.cxx.

◆ header() [2/12]

const H_ContentDescription::Type & Contents::header ( const H_ContentDescription &  headerType) const

returns the Content-Description MIME header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentDescription)
Returns
the Content-Description MIME header

Definition at line 388 of file Contents.cxx.

◆ header() [3/12]

H_ContentDisposition::Type & Contents::header ( const H_ContentDisposition &  headerType)

returns the value of the Content-Disposition header

retval = contents.header(Headers::ContentDisposition);
Returns
the Content-Disposition header value

Definition at line 313 of file Contents.cxx.

◆ header() [4/12]

const H_ContentDisposition::Type & Contents::header ( const H_ContentDisposition &  headerType) const

returns the value of the Content-Disposition header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentDisposition);
Returns
the Content-Disposition header value

Definition at line 292 of file Contents.cxx.

◆ header() [5/12]

H_ContentID::Type & Contents::header ( const H_ContentID &  headerType)

returns the value of the Content-ID MIME header

retval = contents.header(Headers::ContentId);
Returns
the Content-Id MIME header value

Definition at line 441 of file Contents.cxx.

◆ header() [6/12]

const H_ContentID::Type & Contents::header ( const H_ContentID &  headerType) const

returns the value of the Content-ID MIME header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentId);
Returns
the Content-Id MIME header value

Definition at line 420 of file Contents.cxx.

◆ header() [7/12]

H_ContentLanguages::Type & Contents::header ( const H_ContentLanguages &  headerType)

returns the value of the Content-Languages header

retval = contents.header(Headers::ContentLanguages);
Returns
the Content-Languages header value

Definition at line 377 of file Contents.cxx.

◆ header() [8/12]

const H_ContentLanguages::Type & Contents::header ( const H_ContentLanguages &  headerType) const

returns the value of the Content-Languages header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentLanguages);
Returns
the Content-Languages header value

Definition at line 356 of file Contents.cxx.

◆ header() [9/12]

H_ContentTransferEncoding::Type & Contents::header ( const H_ContentTransferEncoding &  headerType)

returns the value of the Content-Transfer-Encoding header

retval = contents.header(Headers::ContentTransferEncoding);
Returns
the Content-Transfer-Encoding header value

Definition at line 345 of file Contents.cxx.

◆ header() [10/12]

const H_ContentTransferEncoding::Type & Contents::header ( const H_ContentTransferEncoding &  headerType) const

returns the value of the Content-Transfer-Encoding header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentTransferEncoding);
Returns
the Content-Transfer-Encoding header value

Definition at line 324 of file Contents.cxx.

◆ header() [11/12]

H_ContentType::Type & Contents::header ( const H_ContentType &  headerType)

returns the value of the Content-Type header

retval = contents.header(Headers::ContentType);
Returns
the Content-Type header value

Definition at line 286 of file Contents.cxx.

◆ header() [12/12]

const H_ContentType::Type & Contents::header ( const H_ContentType &  headerType) const

returns the value of the Content-Type header Throws an Contents::Exception if the header doesn't exist.

retval = contents.header(Headers::ContentType);
Returns
the Content-Type header value

Definition at line 280 of file Contents.cxx.

◆ init() [1/2]

void resip::Contents::init ( )
inlineprotected

Definition at line 301 of file Contents.hxx.

◆ init() [2/2]

void Contents::init ( const Contents &  orig)
protected

Definition at line 84 of file Contents.cxx.

◆ minorVersion()

int & resip::Contents::minorVersion ( )
inline

returns the minor version of MIME used by the contents

Returns
MIME minor version

Definition at line 280 of file Contents.hxx.

◆ operator=()

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

Assignment operator.

Parameters
rhsContents object to be copied
Returns
a reference to a copy of rhs

Definition at line 71 of file Contents.cxx.

◆ preParseHeaders()

void Contents::preParseHeaders ( ParseBuffer &  pb)

Preforms preparsing on the headers stored in the ParseBuffer pb.

Parameters
pba ParseBuffer containing the headers to preparse

Definition at line 453 of file Contents.cxx.

◆ remove() [1/2]

void Contents::remove ( const HeaderBase &  headerType)

removes a header if it is present

Parameters
headerTypethe header to remove

Definition at line 232 of file Contents.cxx.

◆ remove() [2/2]

void Contents::remove ( const MIME_Header &  headerType)

removes a MIME header if it is present

Parameters
headerTypethe MIME header to remove

Definition at line 260 of file Contents.cxx.

◆ version()

int & resip::Contents::version ( )
inline

returns the major version of MIME used by the contents

Returns
MIME major version

Definition at line 275 of file Contents.hxx.

Member Data Documentation

◆ mBufferList

std::vector<char*> resip::Contents::mBufferList
protected

Definition at line 361 of file Contents.hxx.

◆ mDescription

H_ContentDescription::Type* resip::Contents::mDescription
protected

Definition at line 352 of file Contents.hxx.

◆ mDisposition

H_ContentDisposition::Type* resip::Contents::mDisposition
protected

Definition at line 344 of file Contents.hxx.

◆ mId

Token* resip::Contents::mId
protected

Definition at line 350 of file Contents.hxx.

◆ mLanguages

H_ContentLanguages::Type* resip::Contents::mLanguages
protected

Definition at line 348 of file Contents.hxx.

◆ mLength

StringCategory* resip::Contents::mLength
protected

Definition at line 354 of file Contents.hxx.

◆ mMinorVersion

int resip::Contents::mMinorVersion
protected

Definition at line 359 of file Contents.hxx.

◆ mTransferEncoding

H_ContentTransferEncoding::Type* resip::Contents::mTransferEncoding
protected

Definition at line 346 of file Contents.hxx.

◆ mType

Mime resip::Contents::mType
protected

Definition at line 342 of file Contents.hxx.

◆ mVersion

int resip::Contents::mVersion
protected

Definition at line 357 of file Contents.hxx.


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