VMime
mailbox Class Reference

#include <mailbox.hpp>

Inheritance diagram for mailbox:
Collaboration diagram for mailbox:

Public Member Functions

 mailbox ()
 mailbox (const mailbox &mbox)
 mailbox (const emailAddress &email)
 mailbox (const text &name, const emailAddress &email)
const textgetName () const
void setName (const text &name)
const emailAddressgetEmail () const
void setEmail (const emailAddress &email)
bool operator== (const class mailbox &mailbox) const
bool operator!= (const class mailbox &mailbox) const
void copyFrom (const component &other)
shared_ptr< componentclone () const
mailboxoperator= (const mailbox &other)
bool isEmpty () const
void clear ()
const std::vector< shared_ptr< component > > getChildComponents ()
bool isGroup () const
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
Public Member Functions inherited from headerFieldValue
size_t getGeneratedSize (const generationContext &ctx)
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)
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
size_t getParsedOffset () const
size_t getParsedLength () const

Protected Attributes

text m_name
emailAddress m_email

Additional Inherited Members

Static Public Member Functions inherited from address
static shared_ptr< addressparseNext (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition, bool *isLastAddressOfGroup)
Protected Member Functions inherited from address
 address ()
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 &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

A mailbox: full name + email (basic type).

Constructor & Destructor Documentation

◆ mailbox() [1/4]

◆ mailbox() [2/4]

mailbox ( const mailbox & mbox)

◆ mailbox() [3/4]

mailbox ( const emailAddress & email)

References m_email.

◆ mailbox() [4/4]

mailbox ( const text & name,
const emailAddress & email )

References m_email, and m_name.

Member Function Documentation

◆ clear()

void clear ( )

References m_email, and m_name.

Referenced by mailboxField.

◆ clone()

shared_ptr< component > clone ( ) const
virtual

Clone this component.

Returns
a copy of this component

Implements address.

Referenced by mailboxField.

◆ copyFrom()

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_exceptionif the components are not of the same (dynamic) type
Parameters
otherother component to copy data from

Implements component.

References m_email, m_name, and mailbox().

Referenced by mailboxField, and operator=().

◆ generateImpl()

void generateImpl ( const generationContext & ctx,
utility::outputStream & os,
const size_t curLinePos = 0,
size_t * newLinePos = NULL ) const
virtual

◆ getChildComponents()

const std::vector< shared_ptr< component > > getChildComponents ( )
virtual

Return the list of children of this component.

Returns
list of child components

Implements component.

Referenced by mailboxField.

◆ getEmail()

const emailAddress & getEmail ( ) const

Return the email of the mailbox.

Returns
email of the mailbox

References m_email.

Referenced by SMTPCommand::MAIL(), mailboxField, MDNHelper::needConfirmation(), SMTPCommand::RCPT(), and sendmailTransport::send().

◆ getName()

const text & getName ( ) const

Return the full name of the mailbox (empty if not specified).

Returns
full name of the mailbox

References m_name.

Referenced by mailboxField.

◆ isEmpty()

bool isEmpty ( ) const
virtual

Check whether this address is empty (no mailboxes specified if this is a mailboxGroup -or- no email specified if this is a mailbox).

Returns
true if this address is empty

Implements address.

References m_email.

Referenced by mailboxField, and sendmailTransport::send().

◆ isGroup()

bool isGroup ( ) const
virtual

Test whether this is object is a mailboxGroup.

Returns
true if this is a mailboxGroup, false otherwise

Implements address.

Referenced by mailboxField.

◆ operator!=()

bool operator!= ( const class mailbox & mailbox) const

References mailbox().

Referenced by mailboxField.

◆ operator=()

mailbox & operator= ( const mailbox & other)

References copyFrom(), and mailbox().

Referenced by mailboxField.

◆ operator==()

bool operator== ( const class mailbox & mailbox) const

References m_email, m_name, and mailbox().

Referenced by mailboxField.

◆ parseImpl()

void parseImpl ( const parsingContext & ctx,
const string & buffer,
const size_t position,
const size_t end,
size_t * newPosition = NULL )
virtual

◆ setEmail()

void setEmail ( const emailAddress & email)

Set the email of the mailbox.

Parameters
emailemail of the mailbox

References m_email.

Referenced by mailboxField.

◆ setName()

void setName ( const text & name)

Set the full name of the mailbox.

Parameters
namefull name of the mailbox

References m_name.

Referenced by mailboxField.

Member Data Documentation

◆ m_email

◆ m_name


The documentation for this class was generated from the following files: