VMime
mailboxGroup Class Reference

#include <mailboxGroup.hpp>

Inheritance diagram for mailboxGroup:
Collaboration diagram for mailboxGroup:

Public Member Functions

 mailboxGroup ()
 mailboxGroup (const mailboxGroup &mboxGroup)
 mailboxGroup (const text &name)
 ~mailboxGroup ()
void copyFrom (const component &other)
shared_ptr< componentclone () const
mailboxGroupoperator= (const component &other)
const std::vector< shared_ptr< component > > getChildComponents ()
const textgetName () const
void setName (const text &name)
void appendMailbox (shared_ptr< mailbox > mbox)
void insertMailboxBefore (shared_ptr< mailbox > beforeMailbox, shared_ptr< mailbox > mbox)
void insertMailboxBefore (const size_t pos, shared_ptr< mailbox > mbox)
void insertMailboxAfter (shared_ptr< mailbox > afterMailbox, shared_ptr< mailbox > mbox)
void insertMailboxAfter (const size_t pos, shared_ptr< mailbox > mbox)
void removeMailbox (shared_ptr< mailbox > mbox)
void removeMailbox (const size_t pos)
void removeAllMailboxes ()
size_t getMailboxCount () const
bool isEmpty () const
shared_ptr< mailboxgetMailboxAt (const size_t pos)
const shared_ptr< const mailboxgetMailboxAt (const size_t pos) const
const std::vector< shared_ptr< const mailbox > > getMailboxList () const
const std::vector< shared_ptr< mailbox > > getMailboxList ()
bool isGroup () 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 Member Functions

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
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 ()

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)

Detailed Description

A group of mailboxes (basic type).

Constructor & Destructor Documentation

◆ mailboxGroup() [1/3]

mailboxGroup ( )

Referenced by copyFrom(), mailboxGroup(), and operator=().

◆ mailboxGroup() [2/3]

mailboxGroup ( const mailboxGroup & mboxGroup)

◆ mailboxGroup() [3/3]

mailboxGroup ( const text & name)

◆ ~mailboxGroup()

Member Function Documentation

◆ appendMailbox()

void appendMailbox ( shared_ptr< mailbox > mbox)

Add a mailbox at the end of the list.

Parameters
mboxmailbox to append

◆ clone()

shared_ptr< component > clone ( ) const
virtual

Clone this component.

Returns
a copy of this component

Implements address.

◆ 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 vmime::clone(), mailboxGroup(), and removeAllMailboxes().

Referenced by mailboxGroup(), and operator=().

◆ generateImpl()

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

◆ getChildComponents()

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

Return the list of children of this component.

Returns
list of child components

Implements component.

References vmime::copy_vector().

◆ getMailboxAt() [1/2]

shared_ptr< mailbox > getMailboxAt ( const size_t pos)

Return the mailbox at the specified position.

Parameters
posposition
Returns
mailbox at position 'pos'
Exceptions
std::out_of_rangeif the position is out of range

◆ getMailboxAt() [2/2]

const shared_ptr< const mailbox > getMailboxAt ( const size_t pos) const

Return the mailbox at the specified position.

Parameters
posposition
Returns
mailbox at position 'pos'
Exceptions
std::out_of_rangeif the position is out of range

◆ getMailboxCount()

size_t getMailboxCount ( ) const

Return the number of mailboxes in the list.

Returns
number of mailboxes

◆ getMailboxList() [1/2]

const std::vector< shared_ptr< mailbox > > getMailboxList ( )

Return the mailbox list.

Returns
list of mailboxes

◆ getMailboxList() [2/2]

const std::vector< shared_ptr< const mailbox > > getMailboxList ( ) const

Return the mailbox list.

Returns
list of mailboxes

◆ getName()

const text & getName ( ) const

Return the name of the group.

Returns
group name

◆ insertMailboxAfter() [1/2]

void insertMailboxAfter ( const size_t pos,
shared_ptr< mailbox > mbox )

Insert a new mailbox after the specified position.

Parameters
posposition of the mailbox before the new mailbox
mboxmailbox to insert
Exceptions
std::out_of_rangeif the position is out of range

◆ insertMailboxAfter() [2/2]

void insertMailboxAfter ( shared_ptr< mailbox > afterMailbox,
shared_ptr< mailbox > mbox )

Insert a new mailbox after the specified mailbox.

Parameters
afterMailboxmailbox after which the new mailbox will be inserted
mboxmailbox to insert
Exceptions
std::out_of_rangeif the mailbox is not in the list

◆ insertMailboxBefore() [1/2]

void insertMailboxBefore ( const size_t pos,
shared_ptr< mailbox > mbox )

Insert a new mailbox before the specified position.

Parameters
posposition at which to insert the new mailbox (0 to insert at the beginning of the list)
mboxmailbox to insert
Exceptions
std::out_of_rangeif the position is out of range

◆ insertMailboxBefore() [2/2]

void insertMailboxBefore ( shared_ptr< mailbox > beforeMailbox,
shared_ptr< mailbox > mbox )

Insert a new mailbox before the specified mailbox.

Parameters
beforeMailboxmailbox before which the new mailbox will be inserted
mboxmailbox to insert
Exceptions
std::out_of_rangeif the mailbox is not in the list

◆ isEmpty()

bool isEmpty ( ) const
virtual

Tests whether the list of mailboxes is empty.

Returns
true if there is no mailbox, false otherwise

Implements address.

◆ isGroup()

bool isGroup ( ) const
virtual

Test whether this is object is a mailboxGroup.

Returns
true if this is a mailboxGroup, false otherwise

Implements address.

◆ operator=()

mailboxGroup & operator= ( const component & other)

References copyFrom(), and mailboxGroup().

◆ parseImpl()

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

◆ removeAllMailboxes()

void removeAllMailboxes ( )

Remove all mailboxes from the list.

Referenced by copyFrom(), and ~mailboxGroup().

◆ removeMailbox() [1/2]

void removeMailbox ( const size_t pos)

Remove the mailbox at the specified position.

Parameters
posposition of the mailbox to remove
Exceptions
std::out_of_rangeif the position is out of range

◆ removeMailbox() [2/2]

void removeMailbox ( shared_ptr< mailbox > mbox)

Remove the specified mailbox from the list.

Parameters
mboxmailbox to remove
Exceptions
std::out_of_rangeif the mailbox is not in the list

◆ setName()

void setName ( const text & name)

Set the name of the group.

Parameters
namegroup name

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