You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdepim/mimelib/doc/text.html

150 lines
5.9 KiB

<HTML>
<HEAD>
<TITLE> DwText Man Page </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>
<FONT COLOR="navy"> NAME </FONT>
</H2>
<P>
DwText -- Class representing text in a RFC-822 header field-body
<H2>
<FONT COLOR="navy"> SYNOPSIS </FONT>
</H2>
<PRE>class DW_EXPORT DwText : public <A HREF="fieldbdy.html">DwFieldBody</A> {
public:
<A HREF="text.html#DwText">DwText</A>();
<A HREF="text.html#DwText">DwText</A>(const DwText&amp; aText);
<A HREF="text.html#DwText">DwText</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
virtual ~DwText();
const DwText&amp; <A HREF="text.html#op_eq">operator =</A> (const DwText&amp; aText);
virtual void <A HREF="text.html#Parse">Parse</A>();
virtual void <A HREF="text.html#Assemble">Assemble</A>();
virtual DwMessageComponent* <A HREF="text.html#Clone">Clone</A>() const;
static DwText* <A HREF="text.html#NewText">NewText</A>(const DwString&amp; aStr, DwMessageComponent* aParent);
static DwText* (*<A HREF="text.html#sNewText">sNewText</A>)(const DwString&amp;, DwMessageComponent*);
public:
virtual void <A HREF="text.html#PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; aStrm, int aDepth=0) const;
virtual void <A HREF="text.html#CheckInvariants">CheckInvariants</A>() const;
protected:
void _PrintDebugInfo(ostream&amp; aStrm) const;
};
</PRE>
<H2>
<FONT COLOR="navy"> DESCRIPTION </FONT>
</H2>
<P>
<B><TT>DwText</TT></B> represents an unstructured field body in a header
field. It roughly corresponds to the <I>text</I> element of the BNF grammar
defined in RFC-822.
<H2>
<FONT COLOR="navy"> Public Member Functions </FONT>
</H2>
<P>
<FONT COLOR="teal"><B> <A NAME="DwText">DwText</A>() <BR>
DwText(const DwText&amp; aText) <BR>
DwText(const DwString&amp; aStr, DwMessageComponent* aParent=0) </B></FONT>
<P>
The first constructor is the default constructor, which sets the
<B><TT>DwText</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 copies the string
representation from <B><TT>aText</TT></B>. The parent of the new
<B><TT>DwText</TT></B> object is set to NULL.
<P>
The third constructor copies <B><TT>aStr</TT></B> to the
<B><TT>DwText</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 DwText&amp; <A NAME="op_eq">operator =</A> (const
DwText&amp; aText) </B></FONT>
<P>
This is the assignment operator.
<P>
<FONT COLOR="teal"><B> virtual void <A NAME="Parse">Parse</A>() </B></FONT>
<P>
This virtual member function is inherited from
<B><TT>DwMessageComponent</TT></B>, where it is declared a pure virtual function.
For a <B><TT>DwText</TT></B> object, this member function does nothing, since
<B><TT>DwText</TT></B> represents an unstructured field body (like the Subject
header field) that does not have a broken-down form.
<P>
Note, however, that this function should still be called consistently, since
a subclass of <B><TT>DwText</TT></B> may implement a parse method.
<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 member function is inherited from
<B><TT>DwMessageComponent</TT></B>, where it is declared a pure virtual function.
For a <B><TT>DwText</TT></B> object, this member function does nothing, since
<B><TT>DwText</TT></B> represents an unstructured field body (like the Subject
header field) that does not have a broken-down form.
<P>
Note, however, that this function should still be called consistently, since
a subclass of <B><TT>DwText</TT></B> may implement an assemble method.
<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>DwText</TT></B> on the free store that has the same
value as this <B><TT>DwText</TT></B> object. The basic idea is that of a
``virtual copy constructor.''
<P>
<FONT COLOR="teal"><B> static DwText* <A NAME="NewText">NewText</A>(const
DwString&amp; aStr, DwMessageComponent* aParent) </B></FONT>
<P>
Creates a new <B><TT>DwText</TT></B> object on the free store. If the static
data member <B><TT>sNewText</TT></B> is NULL, this member function will create
a new <B><TT>DwText</TT></B> and return it. Otherwise,
<B><TT>NewText()</TT></B> will call the user-supplied function pointed to
by <B><TT>sNewText</TT></B>, which is assumed to return an object from a
class derived from <B><TT>DwText</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 DwText*
(*<A NAME="sNewText">sNewText</A>)(const DwString&amp;, DwMessageComponent*)
</B></FONT>
<P>
If <B><TT>sNewText</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>DwText</TT></B>.
</BODY></HTML>