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/msgid.html

199 lines
7.9 KiB

<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&amp; aMsgId);
<A HREF="msgid.html#DwMsgId">DwMsgId</A>(const DwString&amp; aStr, DwMessageComponent* aParent=0);
virtual ~DwMsgId();
const DwMsgId&amp; <A HREF="msgid.html#op_eq">operator =</A> (const DwMsgId&amp; 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&amp; <A HREF="msgid.html#LocalPart">LocalPart</A>() const;
void <A HREF="msgid.html#SetLocalPart">SetLocalPart</A>(const DwString&amp; aLocalPart);
const DwString&amp; <A HREF="msgid.html#Domain">Domain</A>() const;
void <A HREF="msgid.html#SetDomain">SetDomain</A>(const DwString&amp; aDomain);
static DwMsgId* <A HREF="msgid.html#NewMsgId">NewMsgId</A>(const DwString&amp; aStr,
DwMessageComponent* aParent);
static DwMsgId* (*<A HREF="msgid.html#sNewMsgId">sNewMsgId</A>)(const DwString&amp;, DwMessageComponent*);
static const char* <A HREF="msgid.html#sHostName">sHostName</A>;
public:
virtual void <A HREF="msgid.html#PrintDebugInfo">PrintDebugInfo</A>(ostream&amp; aStrm, int aDepth=0) const;
virtual void <A HREF="msgid.html#CheckInvariants">CheckInvariants</A>() const;
protected:
void _PrintDebugInfo(ostream&amp; 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&amp; aMsgId) <BR>
DwMsgId(const DwString&amp; 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&amp; <A NAME="op_eq">operator =</A>
(const DwMsgId&amp; 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&amp;
<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&amp; aLocalPart) </B></FONT>
<P>
Sets the local-part of the msg-id.
<P>
<FONT COLOR="teal"><B> const DwString&amp; <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&amp; 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&amp; 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&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 DwMsgId*
(*<A NAME="sNewMsgId">sNewMsgId</A>)(const DwString&amp;, 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>