Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  

addresslist.h

00001 /***************************************************************************
00002     copyright            : (C) 2002-2005 by Stefano Barbato
00003     email                : [email protected]
00004 
00005     $Id: addresslist_8h-source.html,v 1.4 2006-03-12 12:28:31 tat Exp $
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _MIMETIC_RFC822_ADDRESSLIST_H_
00017 #define _MIMETIC_RFC822_ADDRESSLIST_H_
00018 #include <string>
00019 #include <vector>
00020 #include <mimetic/rfc822/address.h>
00021 #include <mimetic/rfc822/fieldvalue.h>
00022 namespace mimetic 
00023 {
00024 
00025 /// List of Address
00026 /**
00027     AddressList class is a container class that holds Address objects which,
00028       in turn can be a Group or a Mailbox.
00029 
00030     \code
00031     const char* str = "[email protected], friends: [email protected], "
00032                 "[email protected];, [email protected]";
00033     AddressList aList(str);
00034     AddressList::const_iterator bit(aList.begin()), eit(aList.end());
00035     for(; bit != eit; ++bit)
00036     {
00037         Address& adr = *bit;
00038         if(adr.isGroup())
00039             cout << *adr.group();
00040         else
00041             cout << *adr.mailbox();
00042     }
00043     \endcode
00044 
00045     \sa <a href="../RFC/rfc822.txt">RFC822</a>
00046  */
00047 struct AddressList: public FieldValue, public std::vector<Address>
00048 {
00049     AddressList();
00050     AddressList(const char*);
00051     AddressList(const std::string&);
00052 
00053     std::string str() const;
00054     void set(const std::string&);
00055 protected:
00056     FieldValue* clone() const;
00057 private:
00058 };
00059 
00060 
00061 }
00062 
00063 #endif