class THTTPHdrVal |
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. RHTTPHeaders
Public Member Functions | |
---|---|
THTTPHdrVal() | |
THTTPHdrVal(TInt) | |
THTTPHdrVal(RStringF) | |
THTTPHdrVal(RString) | |
THTTPHdrVal(TDateTime) | |
IMPORT_C THTTPHdrVal | Copy() |
IMPORT_C TDateTime | DateTime() |
IMPORT_C TInt | Int() |
IMPORT_C void | SetDateTime(TDateTime) |
IMPORT_C void | SetInt(TInt) |
IMPORT_C void | SetStr(RString) |
IMPORT_C void | SetStrF(RStringF) |
IMPORT_C RString | Str() |
IMPORT_C RStringF | StrF() |
IMPORT_C THTTPValType | Type() |
operator RString() | |
operator RStringF() | |
operator TDateTime() | |
operator TInt() | |
IMPORT_C TBool | operator!=(THTTPHdrVal) |
IMPORT_C TBool | operator==(THTTPHdrVal) |
Public Member Enumerations | |
---|---|
enum | THTTPValType { KTIntVal = 0x00, KStrVal = 0x01, KDateVal = 0x02, KStrFVal = 0x03, KNoType = 0x04 } |
Private Attributes | |
---|---|
TInt | iMoreSpace |
THTTPValType | iType |
TInt | iVal |
IMPORT_C | 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
IMPORT_C | THTTPHdrVal | ( | TInt | aIntVal | ) |
Constructor for an integer field value
TInt aIntVal | The integer value |
IMPORT_C | THTTPHdrVal | ( | RStringF | aStrVal | ) |
Constructor for an string value
RStringF aStrVal | The string value |
IMPORT_C | THTTPHdrVal | ( | RString | aStrVal | ) |
Constructor for an string value
RString aStrVal | The string value |
IMPORT_C | THTTPHdrVal | ( | TDateTime | aDateVal | ) |
Constructor for an date/time value
TDateTime aDateVal | The date/time value |
IMPORT_C THTTPHdrVal | Copy | ( | ) | const |
Obtain a copy of this header value. This is critical when the header contains a string, since a new string reference must be created The copied header value
IMPORT_C TDateTime | DateTime | ( | ) | const |
Obtain the (date/time) value held within. Panics if the value is of the wrong type Requires that the object was previously set to hold a TDateTime
An date/time value
IMPORT_C TInt | Int | ( | ) | const |
Obtain the (integer) value held within Panics if the value is of the wring type Requires that the object was previously set to hold a TInt
An integer value
IMPORT_C void | SetDateTime | ( | TDateTime | aDateVal | ) |
Set the header value to be the supplied date/time. Any previous value, or its type, are lost.
TDateTime aDateVal | The date/time value |
IMPORT_C void | SetInt | ( | TInt | aIntVal | ) |
Any previous value, or its type, are lost.
TInt aIntVal | The integer value |
IMPORT_C void | SetStr | ( | RString | aStrVal | ) |
Set the header value to be the supplied string. Any previous value, or its type, are lost.
RString aStrVal | The string value |
IMPORT_C void | SetStrF | ( | RStringF | aStrVal | ) |
Any previous value, or its type, are lost.
RStringF aStrVal | The string value |
IMPORT_C RStringF | StrF | ( | ) | const |
Obtain the (string) value held within Panics if the value is of the wring type Requires that the object was previously set to hold a string
A string
IMPORT_C THTTPValType | Type | ( | ) | const |
Determine the type of this header field value A THTTPValType enumeration describing the value's type
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 Requires that the object was previously set to hold a string
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 Requires that the object was previously set to hold a string
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 Requires that the object was previously set to hold a TInt
IMPORT_C TBool | operator!= | ( | THTTPHdrVal | aVal | ) | const |
Comparison operator. Does a comparison based on the current type.
THTTPHdrVal aVal | The string to compare. |
IMPORT_C TBool | operator== | ( | THTTPHdrVal | aVal | ) | const |
Comparison operator. Does a comparison based on the current type.
THTTPHdrVal aVal | The header value to compare. |
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 |