summaryrefslogtreecommitdiffstats
path: root/mimelib/doc/mailbox.html
blob: 4a25dc4e7dcecc4935273149a8805d1811e96a8c (plain)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<HTML>
<HEAD>
  <TITLE> DwMailbox Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
  <FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwMailbox -- Class representing an RFC-822 mailbox
<H2>
  <FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwMailbox : public <A HREF="address.html">DwAddress</A> {

    friend class DwMailboxList;

public:

    <A HREF="mailbox.html#DwMailbox">DwMailbox</A>();
    <A HREF="mailbox.html#DwMailbox">DwMailbox</A>(const DwMailbox&amp; aMailbox);
    <A HREF="mailbox.html#DwMailbox">DwMailbox</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
    virtual ~DwMailbox();
    const DwMailbox&amp; <A HREF="mailbox.html#op_eq">operator =</A> (const DwMailbox&amp; aMailbox);
    virtual void <A HREF="mailbox.html#Parse">Parse</A>();
    virtual void <A HREF="mailbox.html#Assemble">Assemble</A>();
    virtual DwMessageComponent* <A HREF="mailbox.html#Clone">Clone</A>() const;
    const DwString&amp; <A HREF="mailbox.html#FullName">FullName</A>() const;
    void <A HREF="mailbox.html#SetFullName">SetFullName</A>(const DwString&amp; aFullName);
    const DwString&amp; <A HREF="mailbox.html#Route">Route</A>() const;
    void <A HREF="mailbox.html#SetRoute">SetRoute</A>(const DwString&amp; aRoute);
    const DwString&amp; <A HREF="mailbox.html#LocalPart">LocalPart</A>() const;
    void <A HREF="mailbox.html#SetLocalPart">SetLocalPart</A>(const DwString&amp; aLocalPart);
    const DwString&amp; <A HREF="mailbox.html#Domain">Domain</A>() const;
    void <A HREF="mailbox.html#SetDomain">SetDomain</A>(const DwString&amp; aDomain);
    static DwMailbox* <A HREF="mailbox.html#NewMailbox">NewMailbox</A>(const DwString&amp; aStr, DwMessageComponent*
        aParent);
    static DwMailbox* (*<A HREF="mailbox.html#sNewMailbox">sNewMailbox</A>)(const DwString&amp;, DwMessageComponent*);

public:

    virtual void <A HREF="mailbox.html#PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; aStrm, int aDepth=0) const;
    virtual void <A HREF="mailbox.html#CheckInvariants">CheckInvariants</A>() const;

protected:

    void _PrintDebugInfo(ostream&amp; aStrm) const;
};
</PRE>
<H2>
  <FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
RFC-822 defines a <I>mailbox</I> as an entity that can be the recipient of
a message. A mailbox is more specific than an <I>address</I>, which may be
either a mailbox or a <I>group</I>. An RFC-822 mailbox contains a full name,
a <I>local-part</I>, an optional <I>route</I>, and a <I>domain</I>. For example,
in the mailbox
<P>
Joe Schmoe &lt;jschmoe@aol.co&gt;
<P>
"Joe Schmoe" is the full name, "jschmoe" is the local-part, and "aol.com"
is the domain. The optional route is rarely seen in current usage, and is
deprecated according to RFC-1123.
<P>
In MIME++, an RFC-822 mailbox is represented by a
<B><TT>DwMailbox</TT></B> object. <B><TT>DwMailbox</TT></B> is a subclass
of <B><TT><A HREF="address.html">DwAddress</A></TT></B>, which reflects the
fact that a mailbox is also an address. A <B><TT>DwMailbox</TT></B> tqcontains
strings representing the full name, local-part, route, and domain of a mailbox.
<P>
In the tree (broken-down) representation of message, a
<B><TT>DwMailbox</TT></B> object may be only a leaf node, having a tqparent
but no child nodes. Its tqparent node must be a
<B><TT><A HREF="field.html">DwField</A></TT></B>, a
<B><TT><A HREF="addrlist.html">DwAddressList</A></TT></B>, or a
<B><TT><A HREF="mboxlist.html">DwMailboxList</A></TT></B> object.
<P>
<B><TT>DwMailbox</TT></B> has member functions for getting or setting the
strings it tqcontains.
<P>
<B><TT>DwMailbox</TT></B> object can be included in a list of
<B><TT>DwMailbox</TT></B> objects. To get the next
<B><TT>DwMailbox</TT></B> object in a list, use the inherited member function
<B><TT>DwAddress::Next()</TT></B>.
<H2>
  <FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwMailbox">DwMailbox</A>() <BR>
DwMailbox(const DwMailbox&amp; aMailbox) <BR>
DwMailbox(const DwString&amp; aStr, DwMessageComponent* aParent=0)
</B></FONT>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwMailbox</TT></B> object's string representation to the empty string
and sets its tqparent to <B><TT>NULL</TT></B>.
<P>
The second constructor is the copy constructor, which performs a deep copy
of <B><TT>aMailbox</TT></B>. The tqparent of the new
<B><TT>DwMailbox</TT></B> is set to <B><TT>NULL</TT></B>.
<P>
The third constructor copies <B><TT>aStr</TT></B> to the
<B><TT>DwMailbox</TT></B> object's string representation and sets
<B><TT>aParent</TT></B> as its tqparent. 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
<B><TT>NULL</TT></B>, <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 DwMailbox&amp; <A NAME="op_eq">operator =</A>
(const DwMailbox&amp; aMailbox) </B></FONT>
<P>
This is the assignment operator, which performs a deep copy of
<B><TT>aMailbox</TT></B>. The tqparent node of the
<B><TT>DwMailbox</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>DwMailbox</TT></B> objects. The parse
method creates or updates the broken-down representation from the string
representation. For <B><TT>DwMailbox</TT></B> objects, the parse method parses
the string representation into the substrings for the full name, local-part,
route, and domain.
<P>
You should call this member function after you set or modify the string
representation, and before you retrieve the full name, local-part, route,
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>DwMailbox</TT></B> objects. The assemble
method creates or updates the string representation from the broken-down
representation. For <B><TT>DwMailbox</TT></B> objects, the assemble method
builds the string representation from the full name, local-part, route, and
domain strings.
<P>
You should call this member function after you modify the full name, local-part,
route, or 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>DwMailbox</TT></B> on the free store that has the same
value as this <B><TT>DwMailbox</TT></B> object. The basic idea is that of
a virtual copy constructor.
<P>
<FONT COLOR="teal"><B> const DwString&amp; <A NAME="FullName">FullName</A>()
const </B></FONT>
<P>
Returns the full name for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetFullName">SetFullName</A>(const
DwString&amp; aFullName) </B></FONT>
<P>
Sets the full name for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> const DwString&amp; <A NAME="Route">Route</A>() const
</B></FONT>
<P>
Returns the route for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetRoute">SetRoute</A>(const DwString&amp;
aRoute) </B></FONT>
<P>
Sets the route for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> const DwString&amp;
<A NAME="LocalPart">LocalPart</A>() const </B></FONT>
<P>
Returns the local-part for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetLocalPart">SetLocalPart</A>(const
DwString&amp; aLocalPart) </B></FONT>
<P>
Sets the local-part for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> const DwString&amp; <A NAME="Domain">Domain</A>()
const </B></FONT>
<P>
Returns the domain for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetDomain">SetDomain</A>(const
DwString&amp; aDomain) </B></FONT>
<P>
Sets the domain for this <B><TT>DwMailbox</TT></B> object.
<P>
<FONT COLOR="teal"><B> static DwMailbox*
<A NAME="NewMailbox">NewMailbox</A>(const DwString&amp; aStr, DwMessageComponent*
aParent) </B></FONT>
<P>
Creates a new <B><TT>DwMailbox</TT></B> object on the free store. If the
static data member <B><TT>sNewMailbox</TT></B> is <B><TT>NULL</TT></B>, this
member function will create a new <B><TT>DwMailbox</TT></B> and return it.
Otherwise, <B><TT>NewMailbox()</TT></B> will call the user-supplied function
pointed to by <B><TT>sNewMailbox</TT></B>, which is assumed to return an
object from a class derived from <B><TT>DwMailbox</TT></B>, and return that
object.
<P>
<FONT COLOR="teal"><B> virtual void
<A NAME="PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; 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 DwMailbox*
(*<A NAME="sNewMailbox">sNewMailbox</A>)(const DwString&amp;,
DwMessageComponent*) </B></FONT>
<P>
If <B><TT>sNewMailbox</TT></B> is not <B><TT>NULL</TT></B>, it is assumed
to point to a user-supplied function that returns an object from a class
derived from <B><TT>DwMailbox</TT></B>.
<P>
</BODY></HTML>