Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mbox.h

Go to the documentation of this file.
00001 /* 
00002  * This file is part of the rfc822 library (C) rebel42@users.sourceforge.net.
00003  *
00004  * The rfc822 library is released under the terms of the GNU Library General Public License as
00005  * published by the Free Software Foundation; either version 2 of the
00006  * License, or (at your option) any later version. See the file COPYING
00007  * as included in the distribution for details.
00008  */
00009 #ifndef RFC822_MBOX_H
00010 #define RFC822_MBOX_H
00011 
00012 #include <string>
00013 #include <list>
00014 #include <map>
00015 #include <set>
00016 
00017 #include <rfc822/msg.h>
00018 
00019 using namespace std;
00020 
00021 class linereader;
00022 class istream;
00023 
00024 namespace rfc822
00025 {
00026 
00028 
00061 class mbox
00062 {
00063 private:
00064         mbox(const mbox&);
00065         mbox& operator = (const mbox&);
00066 public:
00067 
00069 
00077         class iterator
00078         {
00079         public:
00080                 iterator();
00081 
00082                 iterator(const iterator& it);
00083                 iterator& operator = (const iterator& it);
00084 
00085                 msg& operator*() { return m_msg; }
00086                 msg* operator->() { return &m_msg; }
00087                 iterator& operator ++();
00088                 iterator operator ++(int) const;
00089 
00090                 bool operator == (const iterator& m2) const;
00091         private:
00092                 friend class mbox;
00093                 mbox*   m_pParser;
00094                 size_t  m_ofs;
00095                 msg     m_msg;
00096 
00097                 iterator(mbox*);
00098         };
00099 
00101 
00105         mbox(const string& file);
00106         
00108 
00113         mbox(istream& in);
00114         
00116         ~mbox();
00117         
00119         iterator begin()
00120                 { return iterator(this); }
00121         
00123         iterator end() const
00124                 { return iterator(); }
00125         
00126 private:
00127         friend class iterator;
00128         
00130 
00135         size_t parse(size_t ofs, msg& m);
00136         linereader* m_pReader;
00137 };
00138 
00139 }; // namespace
00140 
00141 #endif

Generated on Mon Oct 22 17:03:48 2001 for rfc822 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001