|
VMime
|
#include <component.hpp>


Public Member Functions | |
| component () | |
| virtual | ~component () |
| void | parse (const string &buffer) |
| void | parse (const parsingContext &ctx, const string &buffer) |
| void | parse (shared_ptr< utility::inputStream > inputStream, const size_t length) |
| void | parse (const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
| void | parse (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
| void | parse (shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
| void | parse (const parsingContext &ctx, shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
| virtual const string | generate (const size_t maxLineLength=lineLengthLimits::infinite, const size_t curLinePos=0) const |
| virtual void | generate (utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
| virtual void | generate (const generationContext &ctx, utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
| virtual shared_ptr< component > | clone () const =0 |
| virtual void | copyFrom (const component &other)=0 |
| size_t | getParsedOffset () const |
| size_t | getParsedLength () const |
| virtual const std::vector< shared_ptr< component > > | getChildComponents ()=0 |
| virtual size_t | getGeneratedSize (const generationContext &ctx) |
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 | ( | ) |
Referenced by bodyPart::body, body::bodyPart, body::copyFrom(), bodyPart::copyFrom(), charset::copyFrom(), copyFrom(), emailAddress::copyFrom(), header::copyFrom(), headerField::copyFrom(), parameter::copyFrom(), emailAddress::emailAddress(), emailAddress::emailAddress(), emailAddress::emailAddress(), headerField::header, and parameter::setValue().
|
virtual |
|
pure virtual |
Clone this component.
Implemented in address, addressList, body, bodyPart, charset, contentDisposition, datetime, disposition, emailAddress, encoding, header, headerField, mailbox, mailboxGroup, mailboxList, mediaType, messageId, messageIdSequence, parameter, path, relay, text, and word.
|
pure virtual |
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.
References component(), getParsedLength(), and getParsedOffset().
|
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 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 emailAddress, message, and word.
References generateImpl(), generationContext::getDefaultContext(), and generationContext::setMaxLineLength().
Referenced by textPartFactory::create(), message::generate(), encoding::getEncoder(), headerFieldValue::getGeneratedSize(), and parameter::setValue().
|
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 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 generate(), generate(), and 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.
References vmime::end(), getGeneratedSize(), parseImpl(), and setParsedBounds().
Referenced by 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 getChildComponents().
Referenced by getChildComponents(), and header::getGeneratedSize().
| size_t getParsedLength | ( | ) | const |
Return the length of this component in the parsed message contents.
Use for debugging only.
Referenced by copyFrom().
| size_t getParsedOffset | ( | ) | const |
Return the start position of this component in the parsed message contents.
Use for debugging only.
Referenced by copyFrom().
| void parse | ( | const parsingContext & | ctx, |
| const string & | buffer ) |
Parse RFC-822/MIME data for this component.
| ctx | parsing context |
| buffer | input buffer |
References 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::end(), and 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(), and vmime::end().
| void parse | ( | const string & | buffer | ) |
Parse RFC-822/MIME data for this component, using the default parsing context.
| buffer | input buffer |
Referenced by datetime::datetime(), mediaType::mediaType(), messageId::messageId(), datetime::operator=(), mediaType::operator=(), messageId::operator=(), parse(), 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 |
References vmime::end().
| 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 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.
References vmime::end().
|
protectedvirtual |
Reimplemented in body, and bodyPart.
References vmime::end(), and parseImpl().
Referenced by emailAddress::generate(), getChildComponents(), parse(), parse(), emailAddress::parse(), and parseImpl().
References vmime::end().
Referenced by getChildComponents(), addressList::parseImpl(), body::parseImpl(), bodyPart::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(), and word::parseWithState().