THTTPHdrVal Class Reference

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

Nested Classes and Structures

Public Member Functions
THTTPHdrVal()
THTTPHdrVal(TInt)
THTTPHdrVal(RStringF)
THTTPHdrVal(RString)
THTTPHdrVal(TDateTime)
IMPORT_C THTTPHdrValCopy()
IMPORT_C TDateTimeDateTime()
IMPORT_C TIntInt()
IMPORT_C voidSetDateTime(TDateTime)
IMPORT_C voidSetInt(TInt)
IMPORT_C voidSetStr(RString)
IMPORT_C voidSetStrF(RStringF)
IMPORT_C RStringStr()
IMPORT_C RStringFStrF()
IMPORT_C THTTPValTypeType()
operator RString()
operator RStringF()
operator TDateTime()
operator TInt()
IMPORT_C TBooloperator!=(THTTPHdrVal)
IMPORT_C TBooloperator==(THTTPHdrVal)
Public Member Enumerations
enumTHTTPValType { KTIntVal = 0x00, KStrVal = 0x01, KDateVal = 0x02, KStrFVal = 0x03, KNoType = 0x04 }
Private Attributes
TInt iMoreSpace
THTTPValType iType
TInt iVal

Constructor & Destructor Documentation

THTTPHdrVal()

IMPORT_CTHTTPHdrVal()

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_CTHTTPHdrVal(TIntaIntVal)

Constructor for an integer field value

Parameters

TInt aIntValThe integer value

THTTPHdrVal(RStringF)

IMPORT_CTHTTPHdrVal(RStringFaStrVal)

Constructor for an string value

Parameters

RStringF aStrValThe string value

THTTPHdrVal(RString)

IMPORT_CTHTTPHdrVal(RStringaStrVal)

Constructor for an string value

Parameters

RString aStrValThe string value

THTTPHdrVal(TDateTime)

IMPORT_CTHTTPHdrVal(TDateTimeaDateVal)

Constructor for an date/time value

Parameters

TDateTime aDateValThe date/time value

Member Functions Documentation

Copy()

IMPORT_C THTTPHdrValCopy()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

DateTime()

IMPORT_C TDateTimeDateTime()const
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

Int()

IMPORT_C TIntInt()const
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

SetDateTime(TDateTime)

IMPORT_C voidSetDateTime(TDateTimeaDateVal)

Set the header value to be the supplied date/time. Any previous value, or its type, are lost.

Parameters

TDateTime aDateValThe date/time value

SetInt(TInt)

IMPORT_C voidSetInt(TIntaIntVal)
Set the header value to be the supplied integer.
CAUTION:

Any previous value, or its type, are lost.

Parameters

TInt aIntValThe integer value

SetStr(RString)

IMPORT_C voidSetStr(RStringaStrVal)

Set the header value to be the supplied string. Any previous value, or its type, are lost.

Parameters

RString aStrValThe string value

SetStrF(RStringF)

IMPORT_C voidSetStrF(RStringFaStrVal)
Set the header value to be the supplied string.
CAUTION:

Any previous value, or its type, are lost.

Parameters

RStringF aStrValThe string value

Str()

IMPORT_C RStringStr()const

StrF()

IMPORT_C RStringFStrF()const
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()

IMPORT_C THTTPValTypeType()const

Determine the type of this header field value

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)

IMPORT_C TBooloperator!=(THTTPHdrValaVal)const

Comparison operator. Does a comparison based on the current type.

Parameters

THTTPHdrVal aValThe string to compare.

operator==(THTTPHdrVal)

IMPORT_C TBooloperator==(THTTPHdrValaVal)const

Comparison operator. Does a comparison based on the current type.

Parameters

THTTPHdrVal aValThe header value to compare.

Member Enumerations Documentation

Enum THTTPValType

Enumerators

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

Member Data Documentation

TInt iMoreSpace

TInt iMoreSpace[private]

THTTPValType iType

THTTPValType iType[private]

The current type

TInt iVal

TInt iVal[private]

The value