summaryrefslogtreecommitdiffstats
path: root/mimelib/doc/address.html
blob: f7eb71faf67d517b5e83cbb79ad4ae85d1d99bc3 (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
<HTML>
<HEAD>
  <TITLE> DwAddress Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
  <FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwAddress -- Abstract class representing an RFC-822 address
<H2>
  <FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwAddress : public <A HREF="fieldbdy.html">DwFieldBody</A> {

    friend class DwAddressList;

public:

    virtual ~DwAddress();
    DwBool <A HREF="address.html#IsMailbox">IsMailbox</A>() const;
    DwBool <A HREF="address.html#IsGroup">IsGroup</A>() const;
    inline DwBool <A HREF="address.html#IsValid">IsValid</A>() const;
    DwAddress* <A HREF="address.html#Next">Next</A>() const;
    void <A HREF="address.html#SetNext">SetNext</A>(DwAddress* aAddress);

protected:

    <A HREF="address.html#DwAddress">DwAddress</A>();
    <A HREF="address.html#DwAddress">DwAddress</A>(const DwAddress&amp; aAddr);
    <A HREF="address.html#DwAddress">DwAddress</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
    const DwAddress&amp; <A HREF="address.html#op_eq">operator =</A> (const DwAddress&amp; aAddr);
    int mIsValid;

public:

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

protected:

    void _PrintDebugInfo(ostream&amp; aStrm) const;
};
</PRE>
<H2>
  <FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwAddress</TT></B> represents an <I>address</I> as described in RFC-822.
You may not instantiate objects of type <B><TT>DwAddress</TT></B>, since
<B><TT>DwAddress</TT></B> is an abstract base class. Instead, you must
instantiate objects of type
<B><TT><A HREF="mailbox.html">DwMailbox</A></TT></B> or
<B><TT><A HREF="group.html">DwGroup</A></TT></B>, which are subclasses of
<B><TT>DwAddress</TT></B>.
<P>
To determine the actual type of a <B><TT>DwAddress</TT></B> object, you can
use the member functions <B><TT>IsMailbox()</TT></B> and
<B><TT>IsGroup()</TT></B>.
<P>
If the string representation assigned to a <B><TT>DwAddress</TT></B> is
improperly formed, the parse method will fail. To determine if the parse
method failed, call the member function <B><TT>IsValid()</TT></B>.
<P>
A <B><TT>DwAddress</TT></B> object can be contained in list. To get the next
<B><TT>DwAddress</TT></B> object in the list, call the member function
<B><TT>Next()</TT></B>
<H2>
  <FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> DwBool <A NAME="IsMailbox">IsMailbox</A>() const
</B></FONT>
<P>
Returns true value if this object is a <B><TT>DwMailbox</TT></B>.
<P>
<FONT COLOR="teal"><B> DwBool <A NAME="IsGroup">IsGroup</A>() const
</B></FONT>
<P>
Returns true value if this object is a <B><TT>DwGroup</TT></B>.
<P>
<FONT COLOR="teal"><B> inline DwBool <A NAME="IsValid">IsValid</A>() const
</B></FONT>
<P>
Returns true value if the last parse was successful. Returns false if the
last parse failed (bad address) or the <B><TT>Parse()</TT></B> member function
was never called.
<P>
<FONT COLOR="teal"><B> DwAddress* <A NAME="Next">Next</A>() const </B></FONT>
<P>
Returns the next <B><TT>DwAddress</TT></B> object in the list when the object
is included in a list of addresses. The function is used when iterating a
list.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetNext">SetNext</A>(DwAddress* aAddress)
</B></FONT>
<P>
Sets the next <B><TT>DwAddress</TT></B> object in the list. This member function
generally should not be used, since <B><TT>DwAddressList</TT></B> has member
functions to manage its list of <B><TT>DwAddress</TT></B> objects.
<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"> Protected Member Functions </FONT>
</H2>
<P>
<B><FONT COLOR="teal"> <A NAME="DwAddress">DwAddress</A>() <BR>
DwAddress(const DwAddress&amp; aAddr) <BR>
DwAddress(const DwString&amp; aStr, DwMessageComponent* aParent=0)
</FONT></B>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwAddress</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 copies the string
representation and all attributes from <B><TT>aAddress</TT></B>. The tqparent
of the new <B><TT>DwAddress</TT></B> object is set to
<B><TT>NULL</TT></B>.
<P>
The third constructor copies <B><TT>aStr</TT></B> to the
<B><TT>DwAddress</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>
<B><FONT COLOR="teal"> const DwAddress&amp; <A NAME="op_eq">operator =</A>
(const DwAddress&amp; aAddr) </FONT></B>
<P>
This is the assignment operator, which performs a deep copy of
<B><TT>aAddr</TT></B>. The tqparent node of the <B><TT>DwAddress</TT></B> object
is not changed.
<P>
</BODY></HTML>