
Public Member Functions | |
| MsgId () | |
| Default constructor. | |
| MsgId (const MsgId &other) | |
| Copy constructor. | |
| MsgId (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~MsgId () |
| Destructor. | |
| const MsgId & | operator= (const MsgId &other) |
| Assignment operator. | |
| virtual void | parse () |
| Parses the string representation. | |
| virtual void | assemble () |
| Assembles the string representation. | |
| virtual Node * | clone () const |
| Creates a copy of this object. | |
| const String & | localPart () const |
| Gets the local part. | |
| void | setLocalPart (const String &localPart) |
| Sets the local part. | |
| const String & | domain () const |
| Gets the domain. | |
| void | setDomain (const String &domain) |
| Gets the domain. | |
| virtual void | createDefault () |
| Sets the local part and the domain to default values. | |
| virtual void | createLocalPart () |
| Sets the local part to a default value. | |
| virtual void | createDomain () |
| Sets the domain to a default value. | |
Static Public Member Functions | |
| static void | setDefaultDomain (const char *domain) |
| Sets the default value for the domain. | |
| static MsgId * | newMsgId () |
| Creates a new instance. | |
Static Public Attributes | |
| static MsgId *(* | sNewMsgId )() |
| Provides a class factory hook. | |
Static Protected Attributes | |
| static char * | sDefaultDomain = 0 |
| Default value for the domain. | |
Message-ID: <994590483.5890@somehost.net>
In the above example, the local part is "994590483.5890" and the domain is "somehost.net". In MIME body parts, a message ID can also appear as the field body of the "Content-ID" header field.
In Hunny MIME++, a MsgId contains strings for the local part and the domain.
In the document tree representation of a message, a MsgId object may only be a leaf node, having a parent but no child nodes.
MsgId has member functions for getting or setting its local part and its domain.
MsgId also has a few convenience functions. You may call the member function createLocalPart() to have the library to set a unique local part for you. You may call the member function createDomain() to have the library to set the domain from the default domain. You may call the member function createDefault() to have the library set both the local part and the domain (equivalent to calling createLocalPart() and createDomain()).
You may set the default domain by calling the static member function setDefaultDomain()
| MsgId | ( | ) |
This constructor sets the MsgId object's string representation to the empty string and sets its parent node to NULL.
This constructor performs a deep copy of its argument. The parent node of the new MsgId object is set to NULL.
| other | MsgId instance to copy |
This constructor sets the MsgId object's string representation to str and sets its parent node to parent.
Normally, you call the virtual function parse() immediately after this constructor to create the broken-down representation.
| str | initial value for the string representation | |
| parent | parent node for this object |
| ~MsgId | ( | ) | [virtual] |
Destructor
| void assemble | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the assemble operation for MsgId objects. The assemble operation creates or updates the string representation from the broken-down representation. For MsgId objects, the assemble operation builds the string representation from the local part and the domain.
You should call this member function after you set or modify the local part or the domain, and before you retrieve the string representation.
This function clears the is-modified flag.
Reimplemented from FieldBody.
| Node * clone | ( | ) | const [virtual] |
| void createDefault | ( | ) | [virtual] |
Sets the local part and the domain to default values.
This convenience function is equivalent to calling createLocalPart() and createDomain().
| void createDomain | ( | ) | [virtual] |
Sets the domain to a default value.
You may call the static member function setDefaultDomain() to set the default value.
| void createLocalPart | ( | ) | [virtual] |
Sets the local part to a default value.
The created local part is unique to the local machine. The method creates the local part using the current time, the thread or process ID, and a thread-synchronized counter.
| const mimepp::String & domain | ( | ) | const |
Gets the domain.
| const String & localPart | ( | ) | const |
Gets the local part.
| MsgId * newMsgId | ( | ) | [static] |
Creates a new MsgId object.
If the static data member sNewMsgId is NULL, this member function creates a new MsgId object and returns it. Otherwise, newMsgId() calls the user-supplied function that sNewMsgId points to and returns the object created by that function.
Performs a deep copy of its argument. The parent node of this MsgId object is not changed.
| other | MsgId instance to copy |
| void parse | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the parse operation for MsgId objects. The parse operation creates or updates the broken-down representation from the string representation. For MsgId objects, the parse operation parses the string representation to extract the local part and the domain.
You should call this member function after you set or modify the string representation, and before you retrieve local part or domain.
This function clears the is-modified flag.
Reimplemented from FieldBody.
| void setDefaultDomain | ( | const char * | domain | ) | [static] |
Sets the default domain.
The member function createDomain() uses the value set by this static member function.
The library initialization function mimepp::Initialize() calls this member function to set the default domain. You may call this function from your own code to change the default domain.
Important: This static member function is not thread-safe. To use it safely in a multi-threaded application, you should call it at initialization time before threads are created.
| domain | the value for the default domain |
| void setDomain | ( | const String & | domain | ) |
Sets the domain.
| domain | domain |
| void setLocalPart | ( | const String & | localPart | ) |
Sets the local part.
| localPart | local part |
If sNewMsgId is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of MsgId.
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.