VMime
|
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 | ( | ) |
|
virtual |
|
pure virtual |
Clone this component.
Implemented in header, body, datetime, word, charset, encoding, emailAddress, bodyPart, messageId, parameter, mailbox, path, address, contentDisposition, headerField, text, addressList, mediaType, mailboxGroup, mailboxList, relay, disposition, and messageIdSequence.
|
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 header, body, datetime, word, charset, encoding, bodyPart, emailAddress, messageId, parameter, mailbox, path, contentDisposition, headerField, text, parameterizedHeaderField, addressList, mediaType, mailboxGroup, mailboxList, relay, disposition, and messageIdSequence.
|
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.
References generationContext::getDefaultContext(), and generationContext::setMaxLineLength().
Referenced by textPartFactory::create(), message::generate(), parameter::generateImpl(), mailboxList::generateImpl(), word::generateImpl(), encoding::getEncoder(), headerFieldValue::getGeneratedSize(), SMTPCommand::MAIL(), SMTPCommand::RCPT(), sendmailTransport::send(), 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) |
References generationContext::getDefaultContext().
|
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) |
|
protectedpure virtual |
Implemented in header, body, text, datetime, word, parameterizedHeaderField, mailboxGroup, addressList, headerField, mailboxList, encoding, messageIdSequence, charset, parameter, disposition, bodyPart, emailAddress, messageId, mailbox, mediaType, relay, path, and contentDisposition.
|
pure virtual |
Return the list of children of this component.
Implemented in header, body, datetime, word, parameterizedHeaderField, emailAddress, bodyPart, messageId, encoding, mailbox, parameter, path, charset, contentDisposition, text, headerField, addressList, mediaType, mailboxGroup, mailboxList, relay, disposition, and messageIdSequence.
Referenced by component::getGeneratedSize().
|
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 header, body, headerField, bodyPart, and headerFieldValue.
References 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 string & | buffer | ) |
Parse RFC-822/MIME data for this component, using the default parsing context.
buffer | input buffer |
References parsingContext::getDefaultContext(), and component::parseImpl().
Referenced by datetime::datetime(), emailAddress::emailAddress(), maildirMessage::getParsedMessage(), mediaType::mediaType(), messageId::messageId(), mediaType::operator=(), datetime::operator=(), mailbox::parseImpl(), body::parseImpl(), mediaType::setFromString(), and headerField::setValue().
void parse | ( | const parsingContext & | ctx, |
const string & | buffer | ||
) |
Parse RFC-822/MIME data for this component.
ctx | parsing context |
buffer | input buffer |
References component::parseImpl().
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) |
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 parsingContext::getDefaultContext().
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 |
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 |
References parsingContext::getDefaultContext().
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::utility::bufferedStreamCopyRange().
|
protectedvirtual |
Reimplemented in body, and bodyPart.
Referenced by component::parse().
|
protectedvirtual |
Reimplemented in header, text, datetime, word, parameterizedHeaderField, mailboxGroup, addressList, headerField, mailboxList, encoding, messageIdSequence, charset, parameter, disposition, emailAddress, messageId, mailbox, mediaType, relay, path, and contentDisposition.