File: Header_8hh-source.html

package info (click to toggle)
mailfilter 0.6.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,240 kB
  • ctags: 2,088
  • sloc: ansic: 6,502; sh: 4,388; cpp: 2,169; makefile: 463; yacc: 426; lex: 171; perl: 106; sed: 16
file content (94 lines) | stat: -rw-r--r-- 8,489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>mailfilter: Header.hh Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>Header.hh</h1><a href="Header_8hh.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">// Header.hh - source file for the mailfilter program</span>
00002 <span class="comment">// Copyright (c) 2000 - 2004  Andreas Bauer &lt;baueran@in.tum.de&gt;</span>
00003 <span class="comment">//</span>
00004 <span class="comment">// This program is free software; you can redistribute it and/or modify</span>
00005 <span class="comment">// it under the terms of the GNU General Public License as published by</span>
00006 <span class="comment">// the Free Software Foundation; either version 2 of the License, or</span>
00007 <span class="comment">// (at your option) any later version.</span>
00008 <span class="comment">//</span>
00009 <span class="comment">// This program is distributed in the hope that it will be useful,</span>
00010 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
00011 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
00012 <span class="comment">// GNU General Public License for more details.</span>
00013 <span class="comment">//</span>
00014 <span class="comment">// You should have received a copy of the GNU General Public License</span>
00015 <span class="comment">// along with this program; if not, write to the Free Software</span>
00016 <span class="comment">// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,</span>
00017 <span class="comment">// USA.</span>
00018 
00019 <span class="preprocessor">#ifndef __HEADER_HH_</span>
00020 <span class="preprocessor"></span><span class="preprocessor">#define __HEADER_HH_</span>
00021 <span class="preprocessor"></span>
00022 <span class="preprocessor">#include &lt;string&gt;</span>
00023 <span class="preprocessor">#include &lt;vector&gt;</span>
00024 
00025 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
00026 
<a name="l00027"></a><a class="code" href="namespacemsg.html">00027</a> <span class="keyword">namespace </span>msg {
00028 
00029   <span class="comment">// Class for a _single_ line of a header</span>
<a name="l00030"></a><a class="code" href="classmsg_1_1Line.html">00030</a>   <span class="keyword">class </span><a class="code" href="classmsg_1_1Line.html">Line</a> {
00031   <span class="keyword">private</span>:
00032     string field;
00033     string contents;
00034   
00035   <span class="keyword">public</span>:
00036     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Line.html#a0">descr</a>(<span class="keywordtype">void</span>);
00037     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Line.html#a1">setDescr</a>(<span class="keyword">const</span> string&amp;);
00038     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Line.html#a2">content</a>(<span class="keywordtype">void</span>);
00039     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Line.html#a3">setContent</a>(<span class="keyword">const</span> string&amp;);
00040   };
00041   
00042   <span class="comment">// Class for an entire header</span>
<a name="l00043"></a><a class="code" href="classmsg_1_1Header.html">00043</a>   <span class="keyword">class </span><a class="code" href="classmsg_1_1Header.html">Header</a> { 
00044   <span class="keyword">private</span>:
00045     <span class="comment">// Basic information on the e-mail message header</span>
00046     <span class="keywordtype">int</span> nr;                         <span class="comment">// Nr. of message</span>
00047     <span class="keywordtype">int</span> bytes;                      <span class="comment">// Size of message</span>
00048     vector&lt;Line&gt; content;           <span class="comment">// Each line of the message header</span>
00049     
00050     <span class="comment">// We store those values seperately so it's easier to log the information:</span>
00051     string sndr;                    <span class="comment">// Sender</span>
00052     string subj;                    <span class="comment">// Subject</span>
00053     string dat;                     <span class="comment">// Date</span>
00054     string msgID;                   <span class="comment">// Message ID</span>
00055     string nSubject;                <span class="comment">// Normalised subject string</span>
00056 
00057   <span class="keyword">public</span>:
00058     <a class="code" href="classmsg_1_1Header.html#a0">Header</a>();
00059     <a class="code" href="classmsg_1_1Header.html#a1">~Header</a>();
00060 
00061     <span class="comment">// Accessor functions</span>
00062     <span class="keywordtype">int</span> <a class="code" href="classmsg_1_1Header.html#a2">number</a>(<span class="keywordtype">void</span>);
00063     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a3">setNumber</a>(<span class="keywordtype">int</span>);
00064     <span class="keywordtype">int</span> <a class="code" href="classmsg_1_1Header.html#a4">size</a>(<span class="keywordtype">void</span>);
00065     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a5">setSize</a>(<span class="keywordtype">int</span>);
00066     <span class="keyword">const</span> vector&lt;Line&gt;&amp; <a class="code" href="classmsg_1_1Header.html#a6">lines</a>(<span class="keywordtype">void</span>);
00067     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a7">addLine</a>(<span class="keyword">const</span> <a class="code" href="classmsg_1_1Line.html">Line</a>&amp;);
00068     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Header.html#a8">sender</a>(<span class="keywordtype">void</span>);
00069     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a9">setSender</a>(<span class="keyword">const</span> string&amp;);
00070     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Header.html#a10">subject</a>(<span class="keywordtype">void</span>);
00071     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a11">setSubject</a>(<span class="keyword">const</span> string&amp;);
00072     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Header.html#a12">date</a>(<span class="keywordtype">void</span>);
00073     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a13">setDate</a>(<span class="keyword">const</span> string&amp;);
00074     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Header.html#a14">messageID</a>(<span class="keywordtype">void</span>);
00075     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a15">setMessageID</a>(<span class="keyword">const</span> string&amp;);
00076     <span class="keyword">const</span> string&amp; <a class="code" href="classmsg_1_1Header.html#a16">normalSubject</a>(<span class="keywordtype">void</span>);
00077     <span class="keywordtype">void</span> <a class="code" href="classmsg_1_1Header.html#a17">setNormalSubject</a>(<span class="keyword">const</span> string&amp;);
00078   };
00079 
00080 }
00081 
00082 <span class="preprocessor">#endif</span>
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Sun Aug 8 15:22:26 2004 for mailfilter by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>