component Class Reference

This abstract class is the base for all the classes in the library. More...

Inheritance diagram for component:
Inheritance graph
[legend]
Collaboration diagram for component:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 component ()
virtual ~component ()
void parse (const string &buffer)
virtual void parse (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL)=0
const string generate (const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0) const
virtual void generate (utility::outputStream &os, const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0, string::size_type *newLinePos=NULL) const =0
virtual ref< componentclone () const =0
virtual void copyFrom (const component &other)=0
string::size_type getParsedOffset () const
string::size_type getParsedLength () const
const std::vector< ref
< component > > 
getChildComponents ()
virtual const std::vector< ref
< const component > > 
getChildComponents () const =0

Protected Member Functions

void setParsedBounds (const string::size_type start, const string::size_type end)

Detailed Description

This abstract class is the base for all the classes in the library.

It defines the methods for parsing and generating all the components.


Constructor & Destructor Documentation

component (  ) 
~component (  )  [virtual]

Member Function Documentation

virtual ref<component> clone (  )  const [pure virtual]
virtual void copyFrom ( const component other  )  [pure virtual]

Replace data in this component by data in other component.

Both components must be of the same type.

Exceptions:
std::bad_cast_exception if the components are not of the same (dynamic) type
Parameters:
other other component to copy data from

Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.

virtual void generate ( utility::outputStream os,
const string::size_type  maxLineLength = lineLengthLimits::infinite,
const string::size_type  curLinePos = 0,
string::size_type *  newLinePos = NULL 
) const [pure virtual]

Generate RFC-2822/MIME data for this component.

Parameters:
os output stream
maxLineLength maximum line length for output
curLinePos length of the current line in the output buffer
newLinePos will receive the new line position (length of the last line written)

Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, message, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.

const string generate ( const string::size_type  maxLineLength = lineLengthLimits::infinite,
const string::size_type  curLinePos = 0 
) const

Generate RFC-2822/MIME data for this component.

Deprecated:
Use the new generate() method, which takes an outputStream parameter.
Parameters:
maxLineLength maximum line length for output
curLinePos length of the current line in the output buffer
Returns:
generated data

Reimplemented in message.

Referenced by parameter::setValue().

virtual const std::vector<ref <const component> > getChildComponents (  )  const [pure virtual]

Return the list of children of this component (const version).

Returns:
list of child components

Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.

const std::vector< ref< component > > getChildComponents (  ) 

Return the list of children of this component.

Returns:
list of child components

References vmime::count().

string::size_type getParsedLength (  )  const

Return the length of this component in the parsed message contents.

Returns:
length of the component in parsed buffer or 0 if this component has not been parsed
string::size_type getParsedOffset (  )  const

Return the start position of this component in the parsed message contents.

Returns:
start position in parsed buffer or 0 if this component has not been parsed
virtual void parse ( const string buffer,
const string::size_type  position,
const string::size_type  end,
string::size_type *  newPosition = NULL 
) [pure virtual]

Parse RFC-822/MIME data for this component.

Parameters:
buffer input buffer
position current position in the input buffer
end end position in the input buffer
newPosition will receive the new position in the input buffer

Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.

void parse ( const string buffer  ) 

Parse RFC-822/MIME data for this component.

Parameters:
buffer input buffer

Reimplemented in message.

void setParsedBounds ( const string::size_type  start,
const string::size_type  end 
) [protected]

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

Generated by  doxygen 1.6.2