|
VMime
|
#include <component.hpp>


Protected Member Functions | |
| void | setParsedBounds (const size_t start, const size_t end) |
| virtual void | parseImpl (const parsingContext &ctx, shared_ptr< utility::parserInputStreamAdapter > parser, const size_t position, const size_t end, size_t *newPosition=NULL) |
| virtual void | parseImpl (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
| virtual void | generateImpl (const generationContext &ctx, utility::outputStream &os, const size_t curLinePos=0, size_t *newLinePos=NULL) const =0 |
Protected Member Functions inherited from object | |
| object () | |
| object (const object &) | |
| object & | operator= (const object &) |
| virtual | ~object () |
This abstract class is the base class for all the components of a message.
It defines methods for parsing and generating a component.
| component | ( | ) |
|
virtual |
|
pure virtual |
Clone this component.
Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, path, relay, text, word, and address.
Replace data in this component by data in other component.
Both components must be of the same type.
| std::bad_cast_exception | if the components are not of the same (dynamic) type |
| other | other component to copy data from |
Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.
|
virtual |
Generate RFC-2822/MIME data for this component, using the default generation context.
| ctx | generation context |
| outputStream | output stream |
| curLinePos | length of the current line in the output buffer |
| newLinePos | will receive the new line position (length of the last line written) |
Reimplemented in emailAddress, and word.
References vmime::dynamicCast(), and component::generateImpl().
|
virtual |
Generate RFC-2822/MIME data for this component.
| maxLineLength | maximum line length for output |
| curLinePos | length of the current line in the output buffer |
Reimplemented in message, emailAddress, and word.
References vmime::dynamicCast(), component::generateImpl(), and generationContext::getDefaultContext().
Referenced by textPartFactory::create(), message::generate(), mailboxList::generateImpl(), relay::generateImpl(), encoding::getEncoder(), and headerFieldValue::getGeneratedSize().
|
virtual |
Generate RFC-2822/MIME data for this component, using the default generation context.
| outputStream | output stream |
| curLinePos | length of the current line in the output buffer |
| newLinePos | will receive the new line position (length of the last line written) |
Reimplemented in emailAddress, and word.
References vmime::dynamicCast(), component::generateImpl(), and generationContext::getDefaultContext().
|
protectedpure virtual |
Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.
Referenced by component::generate(), component::generate(), and component::generate().
|
pure virtual |
Return the list of children of this component.
Implemented in addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.
Referenced by component::getGeneratedSize(), and emailAddress::parse().
|
virtual |
Get the number of bytes that will be used by this component when it is generated.
This may be a heuristically-derived estimate, but such an estimated size should always be larger than the actual generated size.
| ctx | generation context |
Reimplemented in body, bodyPart, header, headerField, headerFieldValue, parameter, and parameterizedHeaderField.
References vmime::dynamicCast(), and component::getChildComponents().
Referenced by header::getGeneratedSize().
| size_t getParsedLength | ( | ) | const |
Return the length of this component in the parsed message contents.
Use for debugging only.
| size_t getParsedOffset | ( | ) | const |
Return the start position of this component in the parsed message contents.
Use for debugging only.
| void parse | ( | const parsingContext & | ctx, |
| const string & | buffer | ||
| ) |
Parse RFC-822/MIME data for this component.
| ctx | parsing context |
| buffer | input buffer |
References vmime::dynamicCast(), and component::parseImpl().
| void parse | ( | const parsingContext & | ctx, |
| const string & | buffer, | ||
| const size_t | position, | ||
| const size_t | end, | ||
| size_t * | newPosition = NULL |
||
| ) |
Parse RFC-822/MIME data for this component.
| ctx | parsing context |
| 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 |
References vmime::dynamicCast(), vmime::end(), and component::parseImpl().
| void parse | ( | const parsingContext & | ctx, |
| shared_ptr< utility::inputStream > | inputStream, | ||
| const size_t | position, | ||
| const size_t | end, | ||
| size_t * | newPosition = NULL |
||
| ) |
Parse RFC-822/MIME data for this component.
If stream is not seekable, or if end position is not specified, entire contents of the stream will be loaded into memory before parsing.
| ctx | parsing context |
| inputStream | stream from which to read data |
| position | current position in the input stream |
| end | end position in the input stream |
| newPosition | will receive the new position in the input stream |
References vmime::dynamicCast().
Parse RFC-822/MIME data for this component, using the default parsing context.
| buffer | input buffer |
Referenced by datetime::datetime(), mediaType::mediaType(), messageId::messageId(), messageId::operator=(), datetime::operator=(), mediaType::operator=(), component::parse(), emailAddress::parseImpl(), relay::parseImpl(), body::parseImpl(), mediaType::setFromString(), and headerField::setValue().
| void parse | ( | const string & | buffer, |
| const size_t | position, | ||
| const size_t | end, | ||
| size_t * | newPosition = NULL |
||
| ) |
Parse RFC-822/MIME data for this component, using the default parsing context.
| 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 |
| void parse | ( | shared_ptr< utility::inputStream > | inputStream, |
| const size_t | length | ||
| ) |
Parse RFC-822/MIME data for this component.
If stream is not seekable, or if length is not specified, entire contents of the stream will be loaded into memory before parsing.
| inputStream | stream from which to read data |
| length | data length, in bytes (0 = unknown/not specified) |
References vmime::dynamicCast(), and component::parse().
| void parse | ( | shared_ptr< utility::inputStream > | inputStream, |
| const size_t | position, | ||
| const size_t | end, | ||
| size_t * | newPosition = NULL |
||
| ) |
Parse RFC-822/MIME data for this component.
If stream is not seekable, or if end position is not specified, entire contents of the stream will be loaded into memory before parsing. The default parsing context will be used.
| inputStream | stream from which to read data |
| position | current position in the input stream |
| end | end position in the input stream |
| newPosition | will receive the new position in the input stream |
|
protectedvirtual |
Reimplemented in addressList, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, parameterizedHeaderField, path, relay, text, and word.
|
protectedvirtual |
Reimplemented in body, and bodyPart.
References vmime::dynamicCast(), vmime::end(), and component::parseImpl().
Referenced by emailAddress::generate(), component::parse(), component::parse(), emailAddress::parse(), and component::parseImpl().
References vmime::end().
Referenced by addressList::parseImpl(), charset::parseImpl(), contentDisposition::parseImpl(), datetime::parseImpl(), emailAddress::parseImpl(), encoding::parseImpl(), header::parseImpl(), mailbox::parseImpl(), mailboxGroup::parseImpl(), mailboxList::parseImpl(), mediaType::parseImpl(), messageId::parseImpl(), messageIdSequence::parseImpl(), relay::parseImpl(), text::parseImpl(), body::parseImpl(), bodyPart::parseImpl(), and word::parseWithState().