
Public Member Functions | |
| Parameter () | |
| Default constructor. | |
| Parameter (const Parameter &other) | |
| Copy constructor. | |
| Parameter (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~Parameter () |
| Destructor. | |
| const Parameter & | operator= (const Parameter &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 & | name () const |
| Gets the name. | |
| void | setName (const String &name) |
| Sets the name. | |
| const String & | value () const |
| Gets the value. | |
| void | setValue (const String &value) |
| Sets the value. | |
Static Public Member Functions | |
| static Parameter * | newParameter () |
| Creates a new instance. | |
Static Public Attributes | |
| static Parameter *(* | sNewParameter )() |
| Provides a class factory hook. | |
Content-type: text/plain; charset=iso-8859-1; format=flowed
In the above example, there are two parameters. The first parameter has the name "charset" and the value "iso-8859-1". The second parameter has the name "format" and value "flowed".
Parameter has member functions for getting or setting the parameter's name and value.
| Parameter | ( | ) |
This constructor sets the Parameter 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 Parameter object is set to NULL.
| other | Parameter instance to copy |
This constructor sets the Parameter 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 |
| ~Parameter | ( | ) | [virtual] |
Destructor
| void assemble | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the assemble operation for Parameter objects. The assemble operation creates or updates the string representation from the broken-down representation. For Parameter objects, the assemble operation builds the string representation from the name and value.
You should call this member function after you set or modify the name or value, and before you retrieve the string representation.
This function clears the is-modified flag.
Implements Node.
| Node * clone | ( | ) | const [virtual] |
| const String & name | ( | ) | const |
Gets the name.
| Parameter * newParameter | ( | ) | [static] |
Creates a new Parameter object.
If the static data member sNewParameter is NULL, this member function creates a new Parameter object and returns it. Otherwise, newParameter() calls the user-supplied function that sNewParameter points to and returns the object created by that function.
Performs a deep copy of its argument. The parent node of this Parameter object is not changed.
| other | Parameter instance to copy |
| void parse | ( | ) | [virtual] |
This virtual function, inherited from Node, executes the parse operation for Parameter objects. The parse operation updates the broken-down representation from the string representation. For Parameter objects, the parse operation parses the string representation to extract the name and value of the parameter.
You should call this member function after you set or modify the string representation, and before you retrieve the name or value.
This function clears the is-modified flag.
Implements Node.
| void setName | ( | const String & | name | ) |
Sets the name.
| name | parameter name |
| void setValue | ( | const String & | value | ) |
Sets the value.
| value | parameter value |
| const String & value | ( | ) | const |
Gets the value.
| Parameter *(* sNewParameter)()=0 | ( | ) | [static] |
If sNewParameter is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of Parameter.
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.