VMime
mailbox Class Reference
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 ( const mailbox mbox)
mailbox ( const emailAddress email)
mailbox ( const text name,
const emailAddress email 
)

Member Function Documentation

void clear ( )
shared_ptr< component > clone ( ) const
virtual

Clone this component.

Returns
a copy of this component

Implements address.

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 mailbox::m_email, and mailbox::m_name.

Referenced by mailbox::operator=().

void generateImpl ( const generationContext ctx,
utility::outputStream os,
const size_t  curLinePos = 0,
size_t newLinePos = NULL 
) const
virtual
const std::vector< shared_ptr< component > > getChildComponents ( )
virtual

Return the list of children of this component.

Returns
list of child components

Implements component.

const emailAddress & getEmail ( ) const

Return the email of the mailbox.

Returns
email of the mailbox

References mailbox::m_email.

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

const text & getName ( ) const

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

Returns
full name of the mailbox

References mailbox::m_name.

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 emailAddress::isEmpty(), and mailbox::m_email.

Referenced by messageBuilder::construct(), and sendmailTransport::send().

bool isGroup ( ) const
virtual

Test whether this is object is a mailboxGroup.

Returns
true if this is a mailboxGroup, false otherwise

Implements address.

bool operator!= ( const class mailbox mailbox) const

References mailbox::mailbox().

mailbox & operator= ( const mailbox other)

References mailbox::copyFrom().

bool operator== ( const class mailbox mailbox) const
void parseImpl ( const parsingContext ctx,
const string buffer,
const size_t  position,
const size_t  end,
size_t newPosition = NULL 
)
virtual
void setEmail ( const emailAddress email)

Set the email of the mailbox.

Parameters
emailemail of the mailbox

References mailbox::m_email.

void setName ( const text name)

Set the full name of the mailbox.

Parameters
namefull name of the mailbox

References mailbox::m_name.

Member Data Documentation


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