VMime
addressList Class Reference
Inheritance diagram for addressList:
Collaboration diagram for addressList:

Public Member Functions

 addressList ()
 
 addressList (const addressList &addrList)
 
 ~addressList ()
 
shared_ptr< componentclone () const
 
void copyFrom (const component &other)
 
addressListoperator= (const addressList &other)
 
addressListoperator= (const mailboxList &other)
 
const std::vector< shared_ptr
< component > > 
getChildComponents ()
 
void appendAddress (shared_ptr< address > addr)
 
void insertAddressBefore (shared_ptr< address > beforeAddress, shared_ptr< address > addr)
 
void insertAddressBefore (const size_t pos, shared_ptr< address > addr)
 
void insertAddressAfter (shared_ptr< address > afterAddress, shared_ptr< address > addr)
 
void insertAddressAfter (const size_t pos, shared_ptr< address > addr)
 
void removeAddress (shared_ptr< address > addr)
 
void removeAddress (const size_t pos)
 
void removeAllAddresses ()
 
size_t getAddressCount () const
 
bool isEmpty () const
 
shared_ptr< addressgetAddressAt (const size_t pos)
 
const shared_ptr< const addressgetAddressAt (const size_t pos) const
 
const std::vector< shared_ptr
< const address > > 
getAddressList () const
 
const std::vector< shared_ptr
< address > > 
getAddressList ()
 
shared_ptr< mailboxListtoMailboxList () 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 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 list of addresses.

Constructor & Destructor Documentation

addressList ( const addressList addrList)

Member Function Documentation

void appendAddress ( shared_ptr< address addr)

Add a address at the end of the list.

Parameters
addraddress to append

Referenced by mailboxList::appendMailbox(), and MDNHelper::buildMDN().

shared_ptr< component > clone ( ) const
virtual

Clone this component.

Returns
a copy of this component

Implements component.

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(), and addressList::removeAllAddresses().

Referenced by addressList::addressList(), and addressList::operator=().

void generateImpl ( const generationContext ctx,
utility::outputStream os,
const size_t  curLinePos = 0,
size_t newLinePos = NULL 
) const
protectedvirtual
shared_ptr< address > getAddressAt ( const size_t  pos)

Return the address at the specified position.

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

Referenced by messageBuilder::construct(), and mailboxList::getMailboxAt().

const shared_ptr< const address > getAddressAt ( const size_t  pos) const

Return the address at the specified position.

Parameters
posposition
Returns
address at position 'pos'
Exceptions
std::out_of_rangeif the position is out of range
size_t getAddressCount ( ) const

Return the number of addresses in the list.

Returns
number of addresses

Referenced by mailboxList::getMailboxCount().

const std::vector< shared_ptr< const address > > getAddressList ( ) const

Return the address list.

Returns
list of addresses

Referenced by mailboxList::getMailboxList().

const std::vector< shared_ptr< address > > getAddressList ( )

Return the address list.

Returns
list of addresses
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().

Referenced by mailboxList::getChildComponents().

void insertAddressAfter ( shared_ptr< address afterAddress,
shared_ptr< address addr 
)

Insert a new address after the specified address.

Parameters
afterAddressaddress after which the new address will be inserted
addraddress to insert
Exceptions
std::out_of_rangeif the address is not in the list

Referenced by mailboxList::insertMailboxAfter().

void insertAddressAfter ( const size_t  pos,
shared_ptr< address addr 
)

Insert a new address after the specified position.

Parameters
posposition of the address before the new address
addraddress to insert
Exceptions
std::out_of_rangeif the position is out of range
void insertAddressBefore ( shared_ptr< address beforeAddress,
shared_ptr< address addr 
)

Insert a new address before the specified address.

Parameters
beforeAddressaddress before which the new address will be inserted
addraddress to insert
Exceptions
std::out_of_rangeif the address is not in the list

Referenced by mailboxList::insertMailboxBefore().

void insertAddressBefore ( const size_t  pos,
shared_ptr< address addr 
)

Insert a new address before the specified position.

Parameters
posposition at which to insert the new address (0 to insert at the beginning of the list)
addraddress to insert
Exceptions
std::out_of_rangeif the position is out of range
bool isEmpty ( ) const

Tests whether the list of addresses is empty.

Returns
true if there is no address, false otherwise

Referenced by messageBuilder::construct(), and mailboxList::isEmpty().

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

Reimplemented from component.

References vmime::end(), and address::parseNext().

void removeAddress ( shared_ptr< address addr)

Remove the specified address from the list.

Parameters
addraddress to remove
Exceptions
std::out_of_rangeif the address is not in the list

Referenced by mailboxList::removeMailbox().

void removeAddress ( const size_t  pos)

Remove the address at the specified position.

Parameters
posposition of the address to remove
Exceptions
std::out_of_rangeif the position is out of range
void removeAllAddresses ( )
shared_ptr< mailboxList > toMailboxList ( ) const

Return a list of mailboxes.

If some addresses are actually groups, mailboxes are recursively extracted from these groups.

Returns
list of mailboxes

References vmime::clone().


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