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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
<HTML>
<HEAD>
<TITLE> DwMsgId Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
<FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwMsgId -- Class representing an RFC-822 msg-id
<H2>
<FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwMsgId : public <A HREF="fieldbdy.html">DwFieldBody</A> {
public:
<A HREF="msgid.html#DwMsgId">DwMsgId</A>();
<A HREF="msgid.html#DwMsgId">DwMsgId</A>(const DwMsgId& aMsgId);
<A HREF="msgid.html#DwMsgId">DwMsgId</A>(const DwString& aStr, DwMessageComponent* aParent=0);
virtual ~DwMsgId();
const DwMsgId& <A HREF="msgid.html#op_eq">operator =</A> (const DwMsgId& aMsgId);
virtual void <A HREF="msgid.html#Parse">Parse</A>();
virtual void <A HREF="msgid.html#Assemble">Assemble</A>();
virtual DwMessageComponent* <A HREF="msgid.html#Clone">Clone</A>() const;
virtual void <A HREF="msgid.html#CreateDefault">CreateDefault</A>();
const DwString& <A HREF="msgid.html#LocalPart">LocalPart</A>() const;
void <A HREF="msgid.html#SetLocalPart">SetLocalPart</A>(const DwString& aLocalPart);
const DwString& <A HREF="msgid.html#Domain">Domain</A>() const;
void <A HREF="msgid.html#SetDomain">SetDomain</A>(const DwString& aDomain);
static DwMsgId* <A HREF="msgid.html#NewMsgId">NewMsgId</A>(const DwString& aStr,
DwMessageComponent* aParent);
static DwMsgId* (*<A HREF="msgid.html#sNewMsgId">sNewMsgId</A>)(const DwString&, DwMessageComponent*);
static const char* <A HREF="msgid.html#sHostName">sHostName</A>;
public:
virtual void <A HREF="msgid.html#PrintDebugInfo">PrintDebugInfo</A>(ostream& aStrm, int aDepth=0) const;
virtual void <A HREF="msgid.html#CheckInvariants">CheckInvariants</A>() const;
protected:
void _PrintDebugInfo(ostream& aStrm) const;
};
</PRE>
<H2>
<FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwMsgId</TT></B> represents a <I>msg-id</I> as described in RFC-822.
In the BNF grammar in RFC-822, a msg-id has a <I>local-part</I> and a
<I>domain</I>. In MIME++, a <B><TT>DwMsgId</TT></B> contains strings that
contain the local-part and the domain.
<P>
In the tree (broken-down) representation of message, a
<B><TT>DwMsgId</TT></B> object may only be a leaf node, having a parent but
no child nodes. Its parent node must be a
<A HREF="field.html"><B><TT>DwField</TT></B> </A>object.
<P>
<B><TT>DwMsgId</TT></B> has member functions for getting or setting its
local-part and its domain. You can have the library to create the contents
of a <B><TT>DwMsgId</TT></B> object for you by calling the member function
<B><TT>CreateDefault()</TT></B>.
<H2>
<FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwMsgId">DwMsgId</A>() <BR>
DwMsgId(const DwMsgId& aMsgId) <BR>
DwMsgId(const DwString& aStr, DwMessageComponent* aParent=0) </B></FONT>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwMsgId</TT></B> object's string representation to the empty string
and sets its parent to NULL.
<P>
The second constructor is the copy constructor, which performs a deep copy
of <B><TT>aMsgId</TT></B>. The parent of the new <B><TT>DwMsgId</TT></B>
object is set to NULL.
<P>
The third constructor copies <B><TT>aStr</TT></B> to the
<B><TT>DwMsgId</TT></B> object's string representation and sets
<B><TT>aParent</TT></B> as its parent. The virtual member function
<B><TT>Parse()</TT></B> should be called immediately after this constructor
in order to parse the string representation. Unless it is NULL,
<B><TT>aParent</TT></B> should point to an object of a class derived from
<B><TT>DwField</TT></B>.
<P>
<FONT COLOR="teal"><B> const DwMsgId& <A NAME="op_eq">operator =</A>
(const DwMsgId& aMsgId) </B></FONT>
<P>
This is the assignment operator, which performs a deep copy of
<B><TT>aMsgId</TT></B>. The parent node of the <B><TT>DwMsgId</TT></B> object
is not changed.
<P>
<FONT COLOR="teal"><B> virtual void <A NAME="Parse">Parse</A>() </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
executes the parse method for <B><TT>DwMsgId</TT></B> objects. The parse
method parses the local-part and the domain from the string representation.
<P>
You should call this member function after you set or modify the string
representation, and before you retrieve local-part or domain.
<P>
This function clears the is-modified flag.
<P>
<FONT COLOR="teal"><B> virtual void <A NAME="Assemble">Assemble</A>()
</B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
executes the assemble method for <B><TT>DwMsgId</TT></B> objects. The assemble
method creates or updates the string representation from the local-part and
the domain.
<P>
You should call this member function after you modify the local-part or the
domain, and before you retrieve the string representation.
<P>
This function clears the is-modified flag.
<P>
<FONT COLOR="teal"><B> virtual DwMessageComponent*
<A NAME="Clone">Clone</A>() const </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
creates a new <B><TT>DwMsgId</TT></B> on the free store that has the same
value as this <B><TT>DwMsgId</TT></B> object. The basic idea is that of a
``virtual copy constructor.''
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="CreateDefault">CreateDefault</A>() </B></FONT>
<P>
Creates a value for the msg-id. Uses the current time, process id, and fully
qualified domain name for the host.
<P>
<FONT COLOR="teal"><B> const DwString&
<A NAME="LocalPart">LocalPart</A>() const </B></FONT>
<P>
Returns the local-part of the msg-id.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetLocalPart">SetLocalPart</A>(const
DwString& aLocalPart) </B></FONT>
<P>
Sets the local-part of the msg-id.
<P>
<FONT COLOR="teal"><B> const DwString& <A NAME="Domain">Domain</A>()
const </B></FONT>
<P>
Returns the domain of the msg-id.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetDomain">SetDomain</A>(const
DwString& aDomain) </B></FONT>
<P>
Sets the domain of the msg-id.
<P>
<FONT COLOR="teal"><B> static DwMsgId* <A NAME="NewMsgId">NewMsgId</A>(const
DwString& aStr, DwMessageComponent* aParent) </B></FONT>
<P>
Creates a new <B><TT>DwMsgId</TT></B> object on the free store. If the static
data member <B><TT>sNewMsgId</TT></B> is NULL, this member function will
create a new <B><TT>DwMsgId</TT></B> and return it. Otherwise,
<B><TT>NewMsgId()</TT></B> will call the user-supplied function pointed to
by <B><TT>sNewMsgId</TT></B>, which is assumed to return an object from a
class derived from <B><TT>DwMsgId</TT></B>, and return that object.
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="PrintDebugInfo">PrintDebugInfo</A>(ostream& aStrm, int aDepth=0)
const </B></FONT>
<P>
This virtual function, inherited from <B><TT>DwMessageComponent</TT></B>,
prints debugging information about this object to <B><TT>aStrm</TT></B>.
It will also call <B><TT>PrintDebugInfo()</TT></B> for any of its child
components down to a level of <B><TT>aDepth</TT></B>.
<P>
This member function is available only in the debug version of the library.
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="CheckInvariants">CheckInvariants</A>() const </B></FONT>
<P>
Aborts if one of the invariants of the object fails. Use this member function
to track down bugs.
<P>
This member function is available only in the debug version of the library.
<H2>
<FONT COLOR="navy"> Public Data Members </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> static DwMsgId*
(*<A NAME="sNewMsgId">sNewMsgId</A>)(const DwString&, DwMessageComponent*)
</B></FONT>
<P>
If <B><TT>sNewMsgId</TT></B> is not NULL, it is assumed to point to a
user-supplied function that returns an object from a class derived from
<B><TT>DwMsgId</TT></B>.
<P>
<FONT COLOR="teal"><B> static const char* <A NAME="sHostName">sHostName</A>
</B></FONT>
<P>
Host name of machine, used to create msg-id string. This data member is ignored
if the platform supports a gethostname() function call.
</BODY></HTML>
|