Main Page | Compound List | File List | Compound Members | File Members

HeaderInfo.h

Go to the documentation of this file.
00001 
00002 #ifndef HEADERINFO_H
00003 #define HEADERINFO_H
00004 
00040 #include <stdlib.h>
00041 
00042 #include "MailFilter.h"
00043 
00044 
00050 class HeaderInfo
00051 {
00052  private:
00054   const bool mDoTrace;
00055   char mSubject[128];
00056   char mTo[128];
00057   char mFrom[128];
00058   char mFromNoColon[128];
00059   char mDate[128];
00060   char mReason[128];
00061   MailFilter::classification mKlass;
00062 
00063  private:
00064   HeaderInfo( const HeaderInfo &rhs );
00065   FILE *openTraceFile();
00066   void init();
00067 
00068  public:
00069   HeaderInfo(const bool doTrace);
00070   ~HeaderInfo();
00071   const char *subject();
00072   void subject( const char *pBuf );
00073 
00074   const char *to();
00075   void to(const char *pBuf);
00076 
00077   const char *from();
00078   void from(const char *pBuf);
00079 
00080   const char *fromNoColon();
00081   void fromNoColon(const char *pBuf);
00082 
00083   const char *reason();
00084   void reason(const char *pBuf);
00085 
00086   const char *date();
00087   void date(const char *pBuf);
00088 
00089   const MailFilter::classification klass();
00090   void klass(MailFilter::classification k);
00091 }; // HeaderInfo
00092 
00093 
00094 inline
00095 HeaderInfo::HeaderInfo(const bool doTrace) : mDoTrace(doTrace)
00096 { 
00097   init();
00098 }
00099 
00100 inline
00101 const char *HeaderInfo::subject()
00102 {
00103   return mSubject;
00104 }
00105 
00106 
00107 inline
00108 const char *HeaderInfo::to()
00109 {
00110   return mTo;
00111 }
00112 
00113 inline
00114 void HeaderInfo::to( const char *pBuf )
00115 {
00116   if (pBuf != 0) {
00117     strncpy(mTo, pBuf, sizeof(mTo) );
00118   }
00119 }
00120 
00121 inline
00122 const char *HeaderInfo::from()
00123 {
00124   return mFrom;
00125 }
00126 
00127 inline
00128 void HeaderInfo::from( const char *pBuf )
00129 {
00130   if (pBuf != 0) {
00131     strncpy(mFrom, pBuf, sizeof(mFrom) );
00132   }
00133 }
00134 
00135 inline
00136 const char *HeaderInfo::fromNoColon()
00137 {
00138   return mFromNoColon;
00139 }
00140 
00141 inline
00142 void HeaderInfo::fromNoColon( const char *pBuf )
00143 {
00144   if (pBuf != 0) {
00145     strncpy(mFromNoColon, pBuf, sizeof(mFrom) );
00146   }
00147 }
00148 
00149 inline
00150 const char *HeaderInfo::reason()
00151 {
00152   return mReason;
00153 }
00154 
00155 inline
00156 void HeaderInfo::reason( const char *pBuf )
00157 {
00158   if (pBuf != 0 && *pBuf != '\0') {
00159     strncpy(mReason, pBuf, sizeof(mReason) );
00160   }
00161 }
00162 
00163 
00164 inline
00165 const char *HeaderInfo::date()
00166 {
00167   return mDate;
00168 }
00169 
00170 inline
00171 void HeaderInfo::date(const char *pBuf)
00172 {
00173   strncpy(mDate, pBuf, sizeof(mDate));
00174 }
00175 
00176 inline
00177 const MailFilter::classification  HeaderInfo::klass()
00178 {
00179   return mKlass;
00180 }
00181 
00182 inline
00183 void HeaderInfo::klass(MailFilter::classification k)
00184 {
00185   mKlass = k;
00186 }
00187 
00188 
00189 #endif

Generated on Sat Mar 27 13:07:37 2004 for Mail Filter by doxygen 1.3.3