|
VMime
|
#include <emailAddress.hpp>


Public Member Functions | |
| emailAddress () | |
| emailAddress (const emailAddress &eml) | |
| emailAddress (const string &email) | |
| emailAddress (const char *email) | |
| emailAddress (const string &localName, const string &domainName) | |
| emailAddress (const word &localName, const word &domainName) | |
| const word & | getLocalName () const |
| void | setLocalName (const word &localName) |
| const word & | getDomainName () const |
| void | setDomainName (const word &domainName) |
| bool | isEmpty () const |
| const string | toString () const |
| const text | toText () const |
| bool | operator== (const class emailAddress &eml) const |
| bool | operator!= (const class emailAddress &eml) const |
| void | copyFrom (const component &other) |
| shared_ptr< component > | clone () const |
| emailAddress & | operator= (const emailAddress &other) |
| const std::vector< shared_ptr< component > > | getChildComponents () |
| void | parseImpl (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
| void | generateImpl (const generationContext &ctx, utility::outputStream &os, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
| 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 |
| Public Member Functions inherited from component | |
| 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) |
| size_t | getParsedOffset () const |
| size_t | getParsedLength () const |
| virtual size_t | getGeneratedSize (const generationContext &ctx) |
Protected Attributes | |
| word | m_localName |
| word | m_domainName |
Additional Inherited Members | |
| Protected Member Functions inherited from component | |
| 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) |
| Protected Member Functions inherited from object | |
| object () | |
| object (const object &) | |
| object & | operator= (const object &) |
| virtual | ~object () |
An email address: local name and domain name (basic type).
| emailAddress | ( | ) |
Referenced by copyFrom(), emailAddress(), operator!=(), operator=(), and operator==().
| emailAddress | ( | const emailAddress & | eml | ) |
References component::component(), emailAddress(), m_domainName, and m_localName.
| emailAddress | ( | const char * | ) |
References parse().
References component::component(), m_domainName, and m_localName.
References component::component(), m_domainName, and m_localName.
|
virtual |
|
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 |
Implements component.
References component::component(), emailAddress(), m_domainName, and m_localName.
Referenced by operator=().
|
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 from component.
References vmime::end(), and component::parseImpl().
|
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 from component.
Referenced by SMTPCommand::MAIL(), SMTPCommand::RCPT(), and sendmailTransport::send().
|
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 from component.
|
virtual |
Implements component.
References text::FORCE_NO_ENCODING, word::generate(), context::getInternationalizedEmailSupport(), stringUtils::is7bit(), m_domainName, m_localName, text::QUOTE_IF_NEEDED, and vmime::charsets::UTF_8.
Referenced by toString().
|
virtual |
Return the list of children of this component.
Implements component.
| const word & getDomainName | ( | ) | const |
| const word & getLocalName | ( | ) | const |
| bool isEmpty | ( | ) | const |
Returns whether this email address is empty.
Address is considered as empty if the local part is not specified.
References m_localName.
| bool operator!= | ( | const class emailAddress & | eml | ) | const |
References emailAddress().
| emailAddress & operator= | ( | const emailAddress & | other | ) |
References copyFrom(), and emailAddress().
| bool operator== | ( | const class emailAddress & | eml | ) | const |
References emailAddress(), m_domainName, and m_localName.
| void parse | ( | const parsingContext & | ctx, |
| const string & | buffer ) |
Parse RFC-822/MIME data for this component.
| ctx | parsing context |
| buffer | input buffer |
| 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 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 component::getChildComponents().
| void parse | ( | const string & | buffer | ) |
Parse RFC-822/MIME data for this component, using the default parsing context.
| buffer | input buffer |
References vmime::end(), parsingContext::getDefaultContext(), and parse().
Referenced by emailAddress(), emailAddress(), and parse().
| 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::utility::bufferedStreamCopyRange(), and vmime::end().
| 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 vmime::end(), parsingContext::getDefaultContext(), and component::parseImpl().
|
virtual |
Reimplemented from component.
References vmime::end(), platform::getHandler(), parserHelpers::isSpace(), m_domainName, m_localName, component::setParsedBounds(), and vmime::charsets::UTF_8.
| void setDomainName | ( | const word & | domainName | ) |
Set the domain name of the address.
| domainName | domain name of the address |
References m_domainName.
| void setLocalName | ( | const word & | localName | ) |
Set the local name of the address.
| localName | local name of the address |
References m_localName.
| const string toString | ( | ) | const |
Returns the email address as a string, by joining components.
(ie. the local name, followed by a @ then the domain name.)
References generateImpl(), generationContext::getDefaultContext(), vmime::lineLengthLimits::infinite, and generationContext::setMaxLineLength().
| const text toText | ( | ) | const |
Returns the email address as multibyte text, by joining components.
(ie. the local name, followed by a @ then the domain name.)
References text::appendWord(), m_domainName, m_localName, and vmime::charsets::US_ASCII.
Referenced by SMTPCommand::MAIL(), and SMTPCommand::RCPT().
|
protected |
Referenced by copyFrom(), emailAddress(), emailAddress(), emailAddress(), generateImpl(), getDomainName(), operator==(), parseImpl(), setDomainName(), and toText().
|
protected |
Referenced by copyFrom(), emailAddress(), emailAddress(), emailAddress(), generateImpl(), getLocalName(), isEmpty(), operator==(), parseImpl(), setLocalName(), and toText().