Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <thttphdrval.h>
Link against: http.lib

Class THTTPHdrVal

class THTTPHdrVal;

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.

Members

Defined in THTTPHdrVal:

See also:


Construction and destruction


THTTPHdrVal()

IMPORT_C THTTPHdrVal();

Description

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(RStringF,TInt,THTTPHdrVal &)const


THTTPHdrVal(TInt)

IMPORT_C THTTPHdrVal(TInt aIntVal);

Description

Constructor for an integer field value

Parameters

TInt aIntVal

The integer value


THTTPHdrVal(RStringF)

IMPORT_C THTTPHdrVal(RStringF aStrVal);

Description

Constructor for an string value

Parameters

RStringF aStrVal

The string value


THTTPHdrVal(RString)

IMPORT_C THTTPHdrVal(RString aStrVal);

Description

Constructor for an string value

Parameters

RString aStrVal

The string value


THTTPHdrVal(TDateTime)

IMPORT_C THTTPHdrVal(TDateTime aDateVal);

Description

Constructor for an date/time value

Parameters

TDateTime aDateVal

The date/time value

[Top]


Member functions


Copy()const

IMPORT_C THTTPHdrVal Copy() const;

Description

Obtain a copy of this header value. This is critical when the header contains a string, since a new string reference must be created

Return value

THTTPHdrVal

The copied header value


Type()const

IMPORT_C THTTPValType Type() const;

Description

Determine the type of this header field value

Return value

THTTPHdrVal::THTTPValType

A THTTPValType enumeration describing the value's type


Int()const

IMPORT_C TInt Int() const;

Pre-Condition

Requires that the object was previously set to hold a TInt

Description

Obtain the (integer) value held within Panics if the value is of the wring type

Return value

TInt

An integer value


operator TInt()const

inline operator TInt() const;

Pre-Condition

Requires that the object was previously set to hold a TInt

Description

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

Return value


StrF()const

IMPORT_C RStringF StrF() const;

Pre-Condition

Requires that the object was previously set to hold a string

Description

Obtain the (string) value held within Panics if the value is of the wring type

Return value

RStringF

A string


Str()const

IMPORT_C RString Str() const;

Description

Return value

RString


operator RStringF()const

inline operator RStringF() const;

Pre-Condition

Requires that the object was previously set to hold a string

Description

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

Return value


operator RString()const

inline operator RString() const;

Pre-Condition

Requires that the object was previously set to hold a string

Description

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

Return value


DateTime()const

IMPORT_C TDateTime DateTime() const;

Pre-Condition

Requires that the object was previously set to hold a TDateTime

Description

Obtain the (date/time) value held within. Panics if the value is of the wrong type

Return value

TDateTime

An date/time value


operator TDateTime()const

inline operator TDateTime() const;

Pre-Condition

Requires that the object was previously set to hold a TDateTime

Description

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

Return value


SetInt(TInt)

IMPORT_C void SetInt(TInt aIntVal);

Description

Set the header value to be the supplied integer.

Parameters

TInt aIntVal

The integer value


SetStrF(RStringF)

IMPORT_C void SetStrF(RStringF aStrVal);

Description

Set the header value to be the supplied string.

Parameters

RStringF aStrVal

The string value


SetStr(RString)

IMPORT_C void SetStr(RString aStrVal);

Description

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

Parameters

RString aStrVal

The string value


SetDateTime(TDateTime)

IMPORT_C void SetDateTime(TDateTime aDateVal);

Description

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

Parameters

TDateTime aDateVal

The date/time value


operator==(THTTPHdrVal)const

IMPORT_C TBool operator==(THTTPHdrVal aVal) const;

Description

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

Parameters

THTTPHdrVal aVal

The header value to compare.

Return value

TBool


operator!=(THTTPHdrVal)const

IMPORT_C TBool operator!=(THTTPHdrVal aVal) const;

Description

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

Parameters

THTTPHdrVal aVal

The string to compare.

Return value

TBool

[Top]


Member classes


Class TQConv

class TQConv;

Description

Members

Defined in THTTPHdrVal::TQConv:

Construction and destruction


TQConv(TReal)

inline TQConv(TReal aQ);

Description

Construct from a real number representation of 'q'.

Parameters

TReal aQ


TQConv(TInt)

inline TQConv(TInt aQ);

Description

Construct from a fixed-point representation of 'q'.

Parameters

TInt aQ

Member functions


operator TInt()const

inline operator TInt() const;

Description

Integer cast operator to get the fixed-point representation.

Return value


operator TReal()const

inline operator TReal() const;

Description

TReal cast operator to get the real number representation.

Return value

[Top]


Member enumerations


Enum THTTPValType

THTTPValType

Description

KTIntVal

the value is an integer

KStrVal

the value is a case-sensitive string

KDateVal

the value is a date/time

KStrFVal

the value is a case-insensitive string

KNoType

no value has yet been set