Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  
Public Member Functions | Protected Member Functions | List of all members
Mailbox Struct Reference

Represents a mailbox email address as defined in the RFC822. More...

#include <mailbox.h>

Inheritance diagram for Mailbox:
FieldValue

Public Member Functions

 Mailbox (const char *)
 
 Mailbox (const std::string &)
 
void mailbox (const std::string &)
 
void domain (const std::string &)
 
void label (const std::string &)
 
void sourceroute (const std::string &)
 
std::string mailbox (int bCanonical=1) const
 
std::string domain (int bCanonical=1) const
 
std::string label (int bCanonical=0) const
 
std::string sourceroute (int bCanonical=1) const
 
bool operator== (const Mailbox &) const
 
bool operator!= (const Mailbox &) const
 
void set (const std::string &)
 
std::string str () const
 

Protected Member Functions

FieldValueclone () const
 
- Protected Member Functions inherited from FieldValue
bool typeChecked () const
 
void typeChecked (bool)
 

Detailed Description

Represents a mailbox email address as defined in the RFC822.

Use this class if you want to build or parse email addresses. Each email address as defined by RFC822 have a mailbox std::string, a domain name, a sourceroute and a label. Note that just mailbox and domain are mandatory. Mailboxes can be represented in different ways, can contain rfc822 comments and blank spaces, can be double-quoted and contain source route. Please read the RFC822 for details.

Parsing:

Mailbox mbx("Mario (Spider)Rossi <@free.it@move.it:mrossi@dom.it>");
cout << mbx.mailbox() << endl;
cout << mbx.domain() << endl;
cout << mbx.label() << endl;
cout << mbx.sourceroute() << endl;
cout << mbx.text() << endl;

Building:

Mailbox mbx;
mbx.mailbox("mrossi");
mbx.domain("dom.it");
mbx.label("Mario (Spider)Rossi");
mbx.sourceroute("@free.it@move.it");
See Also
RFC822

The documentation for this struct was generated from the following file: