
Public Member Functions | |
| Field () | |
| Default constructor. | |
| Field (const Field &other) | |
| Copy constructor. | |
| Field (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Field () |
| Destructor. | |
| const Field & | operator= (const Field &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 & | fieldName () const |
| Gets the field name. | |
| void | setFieldName (const String &str) |
| Sets the field name. | |
| class FieldBody & | fieldBody () const |
| Gets the field body. | |
| void | setFieldBody (class FieldBody *fieldBody) |
| Sets the field body. | |
Static Public Member Functions | |
| static class FieldBody * | createFieldBody (const String &fieldName, const String &fieldBody, Node *parent) |
| Creates an instance of a subclass of FieldBody. | |
| static class FieldBody * | _createFieldBody (const String &fieldName, const String &fieldBody, Node *parent) |
| Default factory function for creating FieldBody instances. | |
| static Field * | newField () |
| Creates a new instance. | |
Static Public Attributes | |
| static class FieldBody *(* | sCreateFieldBody )(const String &fieldName, const String &fieldBody, Node *parent) |
| Factory function hook for creating FieldBody instances. | |
| static Field *(* | sNewField )() |
| Provides a class factory hook. | |
Protected Member Functions | |
| void | _setFieldBody (class FieldBody *aFieldBody) |
| Sets the field body. | |
In the document tree representation of a message, a Field object is always an intermediate node, having a parent node and a single child node. The parent node is the Headers object that contains it. The child node is the FieldBody object it contains.
To get or set the field name, use the member functions fieldName() and setFieldName(). To get or set the contained FieldBody object, use fieldBody() and setFieldBody().
| Field | ( | ) |
This constructor sets the Field 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 Field object is set to NULL.
| other | Field instance to copy |
This constructor sets the Field 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 |
| ~Field | ( | ) | [virtual] |
Destructor
| FieldBody * _createFieldBody | ( | const String & | fieldName, | |
| const String & | fieldBody, | |||
| Node * | parent | |||
| ) | [static] |
This static member function is the default factory function for creating FieldBody instances. For a full discussion, see createFieldBody().
| fieldName | field name | |
| fieldBody | field body | |
| parent | parent node of the FieldBody object |
| void _setFieldBody | ( | class FieldBody * | fieldBody | ) | [protected] |
Sets the FieldBody object contained by this object. This function differs from setFieldBody() in that it does not set the is-modified flag.
| fieldBody | field body object |
| void assemble | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the assemble operation for Field objects. The assemble operation creates or updates the string representation from the broken-down representation. For Field objects, the assemble operation builds the string representation from the field name and the string representation of the contained FieldBody object. Before it builds the string representation, this function calls the assemble() member function of its contained FieldBody object.
You should call this member function after you set or modify either the field name or the contained FieldBody object, and before you retrieve the string representation.
This function clears the is-modified flag.
Implements Node.
| Node * clone | ( | ) | const [virtual] |
| FieldBody * createFieldBody | ( | const String & | fieldName, | |
| const String & | fieldBody, | |||
| Node * | parent | |||
| ) | [static] |
The parse() member function calls createFieldBody() to create an instance of a subclass of FieldBody. createFieldBody() examines the field name and creates a subclass of FieldBody that is appropriate for that field.
You may create subclasses of some library classes. To make the library create instances of those subclasses, you must install a factory function, using the Field::sCreateFieldBody hook. If sCreateFieldBody is not NULL, then createFieldBody() calls the function it points to. Otherwise, createFieldBody() calls the default factory function _createFieldBody().
| fieldName | field name | |
| fieldBody | field body | |
| parent | parent node of the FieldBody object |
| FieldBody & fieldBody | ( | ) | const |
| const String & fieldName | ( | ) | const |
Gets the field name.
| Field * newField | ( | ) | [static] |
Creates a new Field object.
If the static data member sNewField is NULL, this member function creates a new Field object and returns it. Otherwise, newField() calls the user-supplied function that sNewField points to and returns the object created by that function.
Performs a deep copy of its argument. The parent node of this Field object is not changed.
| other | Field instance to copy |
| void parse | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the parse operation for Field objects. The parse operation creates or updates the broken-down representation from the string representation. For Field objects, the parse operation updates the value of the field name string and creates an instance of the appropriate subclass of FieldBody. This member function also calls the parse() member function of the FieldBody object it creates.
You should call this member function after you set or modify the string representation, and before you access the field name or field body.
This function clears the is-modified flag.
Implements Node.
| void setFieldBody | ( | class FieldBody * | fieldBody | ) |
Sets the field body.
| fieldBody | the field body object |
| void setFieldName | ( | const String & | name | ) |
Sets the field name.
| name | the field name |
| FieldBody *(* sCreateFieldBody)(const String &, const String &, Node *)=0 | ( | const String & | fieldName, | |
| const String & | fieldBody, | |||
| Node * | parent | |||
| ) | [static] |
This function pointer points to a user-supplied factory function for creating FieldBody instances. For a full discussion, see createFieldBody().
If sNewField is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of Field.
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.