body Class Reference

Body section of a MIME part. More...

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

List of all members.

Public Member Functions

 body ()
 ~body ()
void appendPart (ref< bodyPart > part)
void insertPartBefore (ref< bodyPart > beforePart, ref< bodyPart > part)
void insertPartBefore (const int pos, ref< bodyPart > part)
void insertPartAfter (ref< bodyPart > afterPart, ref< bodyPart > part)
void insertPartAfter (const int pos, ref< bodyPart > part)
void removePart (ref< bodyPart > part)
void removePart (const int pos)
void removeAllParts ()
int getPartCount () const
bool isEmpty () const
ref< bodyPartgetPartAt (const int pos)
const ref< const bodyPartgetPartAt (const int pos) const
const std::vector< ref< const
bodyPart > > 
getPartList () const
const std::vector< ref
< bodyPart > > 
getPartList ()
const stringgetPrologText () const
void setPrologText (const string &prologText)
const stringgetEpilogText () const
void setEpilogText (const string &epilogText)
const ref< const contentHandlergetContents () const
void setContents (ref< const contentHandler > contents)
const mediaType getContentType () const
const charset getCharset () const
const encoding getEncoding () const
ref< componentclone () const
void copyFrom (const component &other)
bodyoperator= (const body &other)
const std::vector< ref< const
component > > 
getChildComponents () const
void parse (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL)
void generate (utility::outputStream &os, const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0, string::size_type *newLinePos=NULL) const

Static Public Member Functions

static const string generateRandomBoundaryString ()
static bool isValidBoundary (const string &boundary)

Detailed Description

Body section of a MIME part.


Constructor & Destructor Documentation

body (  ) 
~body (  ) 

Member Function Documentation

void appendPart ( ref< bodyPart part  ) 

Add a part at the end of the list.

Parameters:
part part to append
ref< component > clone (  )  const [virtual]

Clone this component.

Returns:
a copy of this component

Implements component.

void copyFrom ( const component other  )  [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

Implements component.

void generate ( utility::outputStream os,
const string::size_type  maxLineLength = lineLengthLimits::infinite,
const string::size_type  curLinePos = 0,
string::size_type *  newLinePos = NULL 
) const [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)

Implements component.

const string generateRandomBoundaryString (  )  [static]

Generate a new random boundary string.

Returns:
randomly generated boundary string

References random::getNext(), and random::getTime().

const charset getCharset (  )  const

Return the charset of the data contained in the body contents.

This is a shortcut for getHeader()->ContentType()->getCharset() on the parent part.

Returns:
charset of body contents
const std::vector< ref< const component > > getChildComponents (  )  const [virtual]

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

Returns:
list of child components

Implements component.

const ref< const contentHandler > getContents (  )  const

Return a read-only reference to body contents.

Returns:
read-only body contents
const mediaType getContentType (  )  const

Return the media type of the data contained in the body contents.

This is a shortcut for getHeader()->ContentType()->getValue() on the parent part.

Returns:
media type of body contents

References vmime::fields::CONTENT_TYPE, vmime::mediaTypes::TEXT, and vmime::mediaTypes::TEXT_PLAIN.

const encoding getEncoding (  )  const

Return the encoding used to encode the body contents.

This is a shortcut for getHeader()->ContentTransferEncoding()->getValue() on the parent part.

Returns:
encoding of body contents
const string & getEpilogText (  )  const

Return the epilog text.

Returns:
epilog text
const ref< const bodyPart > getPartAt ( const int  pos  )  const

Return the part at the specified position.

Parameters:
pos position
Returns:
part at position 'pos'
ref< bodyPart > getPartAt ( const int  pos  ) 

Return the part at the specified position.

Parameters:
pos position
Returns:
part at position 'pos'
int getPartCount (  )  const

Return the number of parts in the list.

Returns:
number of parts
const std::vector< ref< bodyPart > > getPartList (  ) 

Return the part list.

Returns:
list of parts
const std::vector< ref< const bodyPart > > getPartList (  )  const

Return the part list.

Returns:
list of parts
const string & getPrologText (  )  const

Return the prolog text.

Returns:
prolog text
void insertPartAfter ( const int  pos,
ref< bodyPart part 
)

Insert a new part after the specified position.

Parameters:
pos position of the part before the new part
part part to insert
void insertPartAfter ( ref< bodyPart afterPart,
ref< bodyPart part 
)

Insert a new part after the specified part.

Parameters:
afterPart part after which the new part will be inserted
part part to insert
Exceptions:
exceptions::no_such_part if the part is not in the list
void insertPartBefore ( const int  pos,
ref< bodyPart part 
)

Insert a new part before the specified position.

Parameters:
pos position at which to insert the new part (0 to insert at the beginning of the list)
part part to insert
void insertPartBefore ( ref< bodyPart beforePart,
ref< bodyPart part 
)

Insert a new part before the specified part.

Parameters:
beforePart part before which the new part will be inserted
part part to insert
Exceptions:
exceptions::no_such_part if the part is not in the list
bool isEmpty (  )  const

Tests whether the list of parts is empty.

Returns:
true if there is no part, false otherwise
bool isValidBoundary ( const string boundary  )  [static]

Test a boundary string for validity (as defined in RFC #1521, page 19).

Parameters:
boundary boundary string to test
Returns:
true if the boundary string is valid, false otherwise
body & operator= ( const body other  ) 
void parse ( const string buffer,
const string::size_type  position,
const string::size_type  end,
string::size_type *  newPosition = NULL 
) [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

contentHandler contents = vmime::create <stringContentHandler>(buffer, position, end, getEncoding());

ref <bodyPart> textPart = textPartFactory::create(partType, contents); copyFrom(*textPart); /*

Implements component.

void removeAllParts (  ) 

Remove all parts from the list.

void removePart ( const int  pos  ) 

Remove the part at the specified position.

Parameters:
pos position of the part to remove
void removePart ( ref< bodyPart part  ) 

Remove the specified part from the list.

Parameters:
part part to remove
Exceptions:
exceptions::no_such_part if the part is not in the list
void setContents ( ref< const contentHandler contents  ) 

Set the body contents.

Parameters:
contents new body contents
void setEpilogText ( const string epilogText  ) 

Set the epilog text.

Parameters:
epilogText new epilog text
void setPrologText ( const string prologText  ) 

Set the prolog text.

Parameters:
prologText new prolog text

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

Generated by  doxygen 1.6.2