summaryrefslogtreecommitdiffstats
path: root/mimelib/doc/fieldbdy.html
blob: 856fd53300dfcd2ed4e57888a66d65fd8402b0ce (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
<HTML>
<HEAD>
  <TITLE> DwFieldBody Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
  <FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwFieldBody -- Class representing a MIME header field body
<H2>
  <FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwFieldBody : public <A HREF="msgcmp.html">DwMessageComponent</A> {

    friend class DwField;

public:

    <A HREF="fieldbdy.html#DwFieldBody">DwFieldBody</A>();
    <A HREF="fieldbdy.html#DwFieldBody">DwFieldBody</A>(const DwFieldBody&amp; aFieldBody);
    <A HREF="fieldbdy.html#DwFieldBody">DwFieldBody</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
    virtual ~DwFieldBody();
    const DwFieldBody&amp; <A HREF="fieldbdy.html#op_eq">operator =</A> (const DwFieldBody&amp; aFieldBody);
    void <A HREF="fieldbdy.html#SetOffset">SetOffset</A>(int aOffset);
    void <A HREF="fieldbdy.html#SetFolding">SetFolding</A>(DwBool aTrueOrFalse);
    DwBool <A HREF="fieldbdy.html#IsFolding">IsFolding</A>() const;

protected:

    int mLineOffset;
    DwBool mDoFolding;

public:

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

protected:

    void _PrintDebugInfo(ostream&amp; aStrm) const;
};
</PRE>
<H2>
  <FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwFieldBody</TT></B> represents the field-body element in the BNF
grammar specified by RFC-822. It is an abstract base class that defines the
interface common to all structured field bodies.
<P>
In the tree (broken-down) representation of a message, a
<B><TT>DwFieldBody</TT></B> object may be either a leaf node, having a parent
but no child nodes, or an intermediate node, having a parent and one or more
child nodes. The parent node is the
<B><TT><A HREF="field.html">DwField</A></TT></B> object that contains it.
Child nodes, if present, depend on the particular subclass of
<B><TT>DwFieldBody</TT></B> that is instantiated. A
<B><TT>DwAddressList</TT></B> object, for example, has
<B><TT>DwAddress</TT></B> objects as its child nodes.
<P>
Since <B><TT>DwFieldBody</TT></B> is an abstract base class, you cannot create
instances of it directly. Normally, objects of classes derived from
<B><TT>DwFieldBody</TT></B> are obtained by calling convenience member functions
in the class <B><TT><A HREF="headers.html">DwHeaders</A></TT></B>.
<P>
Some MIME parsers are broken in that they do not handle the folding of some
fields properly. <B><TT>DwFieldBody</TT></B> folds its string representation
by default. You can disable folding, however, by calling the
<B><TT>SetFolding()</TT></B> member function. To determine if folding is
enabled, call <B><TT>IsFolding()</TT></B>.
<H2>
  <FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwFieldBody">DwFieldBody</A>() <BR>
DwFieldBody(const DwFieldBody&amp; aFieldBody) <BR>
DwFieldBody(const DwString&amp; aStr, DwMessageComponent* aParent=0)
</B></FONT>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwFieldBody</TT></B> object's string representation to the empty string
and sets its parent to <B><TT>NULL</TT></B>.
<P>
The second constructor is the copy constructor, which performs a deep copy
of <B><TT>aFieldBody</TT></B>. The parent of the new
<B><TT>DwFieldBody</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>DwFieldBody</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
<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 DwFieldBody&amp; <A NAME="op_eq">operator =</A>
(const DwFieldBody&amp; aFieldBody) </B></FONT>
<P>
This is the assignment operator, which performs a deep copy of
<B><TT>aFieldBody</TT></B>. The parent node of the
<B><TT>DwFieldBody</TT></B> object is not changed.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetOffset">SetOffset</A>(int aOffset)
</B></FONT>
<P>
Sets the offset to <B><TT>aOffset</TT></B>. The offset is used when folding
lines. It indicates how much the first line should be offset to account for
the field name, colon, and initial white space.
<P>
<FONT COLOR="teal"><B> void <A NAME="SetFolding">SetFolding</A>(DwBool
aTrueOrFalse) </B></FONT>
<P>
Enables (<B><TT>aTrueOrFalse = DwTrue</TT></B>) or disables
(<B><TT>aTrueOrFalse = DwFalse</TT></B>) the folding of fields. The default
is to fold fields. Unfortunately, some parsers are broke and do not handle
folded lines properly. This function allows a kludge to deal with these broken
parsers.
<P>
<FONT COLOR="teal"><B> DwBool <A NAME="IsFolding">IsFolding</A>() const
</B></FONT>
<P>
Returns a boolean indicating if folding of fields is enabled.
<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.
<P>
</BODY></HTML>