Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  
mailboxlist.h
00001 /***************************************************************************
00002     copyright            : (C) 2002-2008 by Stefano Barbato
00003     email                : stefano@codesink.org
00004 
00005     $Id: mailboxlist.h,v 1.12 2008-10-07 11:06:27 tat Exp $
00006  ***************************************************************************/
00007 #ifndef _MIMETIC_RFC822_MAILBOXLIST_H_
00008 #define _MIMETIC_RFC822_MAILBOXLIST_H_
00009 #include <string>
00010 #include <vector>
00011 #include <mimetic/utils.h>
00012 #include <mimetic/rfc822/mailbox.h>
00013 
00014 
00015 namespace mimetic
00016 {
00017 /// List of Mailbox objects
00018 /*!
00019     MailboxList class is a container class that holds Mailbox objects 
00020 
00021     \code
00022     const char* str = "dest@domain.com, friends: one@friends.net, "
00023                 "two@friends.net;, last@users.com";
00024     MailboxList aList(str);
00025     MailboxList::const_iterator bit(aList.begin()), eit(aList.end());
00026     for(; bit != eit; ++bit)
00027     {
00028         cout << *bit;
00029     }
00030     \endcode
00031 
00032     \sa <a href="../RFC/rfc822.txt">RFC822</a>
00033  */
00034 struct MailboxList: public FieldValue, public std::vector<Mailbox>
00035 {
00036     MailboxList();
00037     MailboxList(const char*);
00038     MailboxList(const std::string&);
00039     MailboxList(const std::string&, const std::string&);
00040 
00041     std::string str() const;
00042 protected:
00043     FieldValue* clone() const;
00044 private:
00045     void set(const std::string&);
00046     istring m_name;
00047 };
00048 
00049 
00050 
00051 }
00052 
00053 #endif