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

Header.hh

Go to the documentation of this file.
00001 // Header.hh - source file for the mailfilter program 00002 // Copyright (c) 2000 - 2004 Andreas Bauer <baueran@in.tum.de> 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00017 // USA. 00018 00019 #ifndef __HEADER_HH_ 00020 #define __HEADER_HH_ 00021 00022 #include <string> 00023 #include <vector> 00024 00025 using namespace std; 00026 00027 namespace msg { 00028 00029 // Class for a _single_ line of a header 00030 class Line { 00031 private: 00032 string field; 00033 string contents; 00034 00035 public: 00036 const string& descr(void); 00037 void setDescr(const string&); 00038 const string& content(void); 00039 void setContent(const string&); 00040 }; 00041 00042 // Class for an entire header 00043 class Header { 00044 private: 00045 // Basic information on the e-mail message header 00046 int nr; // Nr. of message 00047 int bytes; // Size of message 00048 vector<Line> content; // Each line of the message header 00049 00050 // We store those values seperately so it's easier to log the information: 00051 string sndr; // Sender 00052 string subj; // Subject 00053 string dat; // Date 00054 string msgID; // Message ID 00055 string nSubject; // Normalised subject string 00056 00057 public: 00058 Header(); 00059 ~Header(); 00060 00061 // Accessor functions 00062 int number(void); 00063 void setNumber(int); 00064 int size(void); 00065 void setSize(int); 00066 const vector<Line>& lines(void); 00067 void addLine(const Line&); 00068 const string& sender(void); 00069 void setSender(const string&); 00070 const string& subject(void); 00071 void setSubject(const string&); 00072 const string& date(void); 00073 void setDate(const string&); 00074 const string& messageID(void); 00075 void setMessageID(const string&); 00076 const string& normalSubject(void); 00077 void setNormalSubject(const string&); 00078 }; 00079 00080 } 00081 00082 #endif

Generated on Sun Aug 8 15:22:26 2004 for mailfilter by doxygen 1.3.8