body Class Reference
Body section of a MIME part.
More...
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< bodyPart > | getPartAt (const int pos) |
| const ref< const bodyPart > | getPartAt (const int pos) const |
const std::vector< ref< const
bodyPart > > | getPartList () const |
const std::vector< ref
< bodyPart > > | getPartList () |
| const string & | getPrologText () const |
| void | setPrologText (const string &prologText) |
| const string & | getEpilogText () const |
| void | setEpilogText (const string &epilogText) |
| const ref< const contentHandler > | getContents () const |
| void | setContents (ref< const contentHandler > contents) |
| const mediaType | getContentType () const |
| const charset | getCharset () const |
| const encoding | getEncoding () const |
| ref< component > | clone () const |
| void | copyFrom (const component &other) |
| body & | operator= (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
Member Function Documentation
| void appendPart |
( |
ref< bodyPart > |
part |
) |
|
Add a part at the end of the list.
- Parameters:
-
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.
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] |
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.
Return a read-only reference to body contents.
- Returns:
- read-only body contents
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:
-
- Returns:
- part at position 'pos'
| ref< bodyPart > getPartAt |
( |
const int |
pos |
) |
|
Return the part at the specified position.
- Parameters:
-
- 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 |
Insert a new part after the specified part.
- Parameters:
-
| afterPart | part after which the new part will be inserted |
| part | part to insert |
- Exceptions:
-
| 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 |
Insert a new part before the specified part.
- Parameters:
-
| beforePart | part before which the new part will be inserted |
| part | part to insert |
- Exceptions:
-
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
| 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.
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:
-
- Exceptions:
-
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: