THTTPHdrVal Class Reference
#include
<mw/http/thttphdrval.h>
Nested Classes and Structures
Detailed Description
A representation of a value found in an HTTP header field. Three fundamental types are used in HTTP - integers, strings (which may be free text, 'enumeration values', URIs, etc. or date/times.
The class allows any of the three values to be held and the current value (as well as its type) to be determined.
THTTPHdrVal instances are used to assign values to header fields, their parts and their associated parameters.
See also: RHTTPHeaders
Member Enumeration Documentation
Enum THTTPValType
Enumerator | Value | Description |
---|
KTIntVal | 0x00 |
the value is an integer
|
KStrVal | 0x01 |
the value is a case-sensitive string
|
KDateVal | 0x02 |
the value is a date/time
|
KStrFVal | 0x03 |
the value is a case-insensitive string
|
KNoType | 0x04 |
no value has yet been set
|
Constructor & Destructor Documentation
THTTPHdrVal ( )
Default constructor Used when constructing an empty header value that is to be filled in by a call to a function. e.g. RHTTPHeaders::GetField
THTTPHdrVal ( TInt )
IMPORT_C | THTTPHdrVal | ( | TInt | aIntVal | ) | |
Constructor for an integer field value
Parameter | Description | aIntVal | The integer value |
THTTPHdrVal ( RStringF )
Constructor for an string value
Parameter | Description | aStrVal | The string value |
THTTPHdrVal ( RString )
IMPORT_C | THTTPHdrVal | ( | RString | aStrVal | ) | |
Constructor for an string value
Parameter | Description | aStrVal | The string value |
THTTPHdrVal ( TDateTime )
Constructor for an date/time value
Parameter | Description | aDateVal | The date/time value |
Member Function Documentation
Copy ( )
Obtain a copy of this header value. This is critical when the header contains a string, since a new string reference must be created
Returns: The copied header value
DateTime ( )
Obtain the (date/time) value held within. Panics if the value is of the wrong type
- Pre-condition
- Requires that the object was previously set to hold a TDateTime
Returns: An date/time value
Int ( )
Obtain the (integer) value held within Panics if the value is of the wring type
- Pre-condition
- Requires that the object was previously set to hold a TInt
Returns: An integer value
SetDateTime ( TDateTime )
Set the header value to be the supplied date/time. Any previous value, or its type, are lost.
Parameter | Description | aDateVal | The date/time value |
SetInt ( TInt )
IMPORT_C void | SetInt | ( | TInt | aIntVal | ) | |
Set the header value to be the supplied integer.
CAUTION:
Any previous value, or its type, are lost.
Parameter | Description | aIntVal | The integer value |
SetStr ( RString )
IMPORT_C void | SetStr | ( | RString | aStrVal | ) | |
Set the header value to be the supplied string. Any previous value, or its type, are lost.
Parameter | Description | aStrVal | The string value |
SetStrF ( RStringF )
Set the header value to be the supplied string.
CAUTION:
Any previous value, or its type, are lost.
Parameter | Description | aStrVal | The string value |
StrF ( )
Obtain the (string) value held within Panics if the value is of the wring type
- Pre-condition
- Requires that the object was previously set to hold a string
Type ( )
Determine the type of this header field value
Returns: A THTTPValType enumeration describing the value's type
operator RString ( )
operator RString | ( | ) | const [inline] |
Cast operator to obtain the
HTTP value as a string. Note this doesn't convert from a different form to string! Panics if the value is of the wring type
- Pre-condition
- Requires that the object was previously set to hold a string
operator RStringF ( )
operator RStringF | ( | ) | const [inline] |
Cast operator to obtain the
HTTP value as a string. Note this doesn't convert from a different form to string! Panics if the value is of the wring type
- Pre-condition
- Requires that the object was previously set to hold a string
operator TDateTime ( )
operator TDateTime | ( | ) | const [inline] |
Cast operator to obtain the
HTTP value as an date/time. Note this doesn't convert from a different form to date! Panics if the value is of the wring type
- Pre-condition
- Requires that the object was previously set to hold a TDateTime
operator TInt ( )
operator TInt | ( | ) | const [inline] |
Cast operator to obtain the
HTTP value as an integer. Note this doesn't convert from a different form to integer! Panics if the value is of the wrong type
- Pre-condition
- Requires that the object was previously set to hold a TInt
operator!= ( THTTPHdrVal )
Comparison operator. Does a comparison based on the current type.
Parameter | Description | aVal | The string to compare. |
operator== ( THTTPHdrVal )
Comparison operator. Does a comparison based on the current type.
Parameter | Description | aVal | The header value to compare. |