Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: http\thttphdrval.h
Link against: http.lib

Class THTTPHdrVal

class THTTPHdrVal

Support

Supported from 7.0

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.), and 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.

Defined in THTTPHdrVal:
Copy(), DateTime(), Int(), KDateVal, KNoType, KStrFVal, KStrVal, KTIntVal, SetDateTime(), SetInt(), SetStr(), SetStrF(), Str(), StrF(), THTTPHdrVal(), THTTPHdrVal(), THTTPHdrVal(), THTTPHdrVal(), THTTPHdrVal(), THTTPValType, TQConv, Type(), iMoreSpace, iType, iVal, operator !=(), operator ==(), operator RString(), operator RStringF(), operator TDateTime(), operator()

See also:


Construction and destruction


THTTPHdrVal()

THTTPHdrVal();

Description

Default constructor.

This is used when constructing an empty field value that is to be filled in by a later function.


THTTPHdrVal()

THTTPHdrVal(TInt aIntVal);

Description

Constructor specifying an integer field value.


THTTPHdrVal()

THTTPHdrVal(RStringF aStrVal);

Description

Constructor specifying a string (RString) field value.


THTTPHdrVal()

THTTPHdrVal(RString aStrVal);

Description

Constructor specifying a string (RStringF) value.


THTTPHdrVal()

THTTPHdrVal(TDateTime aDateVal);

Description

Constructor specifying a date/time value.

[Top]


Member Functions


Copy()

THTTPHdrVal Copy() const;

Description

Copies this field value.

It is critical to use this when the field contains a string, since a new string reference must be created.

Return value

THTTPHdrVal

The copied header value


Type()

THTTPValType Type() const;

Description

Gets the type of this field value.

Return value

THTTPValType

The value's type


Int()

TInt Int() const;

Description

Gets the field's integer value.

This panics if the field value is not an integer.

Return value

TInt

An integer value


operator()

inline operator TInt() const;

Description

Cast operator to obtain the field value as an integer.

Note this doesn't convert from a non-integer field to an integer.

This panics if the field value is not an integer.


StrF()

RStringF StrF() const;

Description

Gets the field's string value as an RStringF.

This panics if the field value is not a string.

Return value

RStringF

The string value


Str()

RString Str() const;

Description

Gets the field's string value as an RString.

This panics if the field value is not a string.

Return value

RString

The string value


operator RStringF()

inline operator RStringF() const;

Description

Cast operator to obtain the field value as a string (RStringF).

Note this doesn't convert from a non-string field to a string.

This panics if the field value is not a string.


operator RString()

inline operator RString() const;

Description

Cast operator to obtain the field value as a string (RString).

Note this doesn't convert from a non-string field to a string.

This panics if the field value is not a string.


DateTime()

TDateTime DateTime() const;

Description

Gets the field's date/time value.

This panics if the field value is not a date/time value.

Return value

TDateTime

Field's date/time value


operator TDateTime()

inline operator TDateTime() const;

Description

Cast operator to obtain the field value as a date/time value.

Note this doesn't convert from a non-date/time value field to a date/time value.

This panics if the field value is not a date/time value.


SetInt()

void SetInt(TInt aIntVal);

Description

Sets the field value to the specified integer.

Any previous value, or its type, are lost.

Parameters

TInt aIntVal

The integer value


SetStrF()

void SetStrF(RStringF aStrVal);

Description

Set the field value to be the specified string (RStringF).

Any previous value, or its type, are lost.

Parameters

RStringF aStrVal

The string value


SetStr()

void SetStr(RString aStrVal);

Description

Set the field value to be the specified string (RString).

Any previous value, or its type, are lost.

Parameters

RString aStrVal

The string value


SetDateTime()

void SetDateTime(TDateTime aDateVal);

Description

Set the field value to be the specified date/time value.

Any previous value, or its type, are lost.

Parameters

TDateTime aDateVal

The date/time value


operator ==()

TBool operator ==(THTTPHdrVal aVal) const;

Description

Equality operator.

Parameters

THTTPHdrVal aVal

The field value to compare

Return value

TBool

ETrue if values are equal, else EFalse


operator !=()

TBool operator !=(THTTPHdrVal aVal) const;

Description

Inequality operator.

Parameters

THTTPHdrVal aVal

The field value to compare.

Return value

TBool

ETrue if values are unequal, else EFalse

[Top]


Member Enumerations


Enum THTTPValType

THTTPValType

Description

Defines types of header field values.

KTIntVal

Integer value.

KStrVal

Case-sensitive string value.

KDateVal

Date/time value.

KStrFVal

Case-insensitive string value.

KNoType

No type.

[Top]


Member Classes


Class TQConv

class TQConv

Description

Utility class that allows clients to convert 'q' values when placing them as parameters to header fields.

Defined in THTTPHdrVal::TQConv:
TQConv(), TQConv(), iFQ, iQ

Construction and destruction


TQConv()

TQConv(TReal aQ);

Description

Constructor specifying a real value.

Parameters

TReal aQ

Real value to convert


TQConv()

TQConv(TInt aQ);

Description

Constructor specifying an integer value.

Parameters

TInt aQ

Integer value to convert


iQ

private: TReal iQ;

Description

This is internal and not intended for use.


iFQ

private: TInt iFQ;

Description

This is internal and not intended for use.

[Top]


Internal members


iType

private: THTTPValType iType;

Description

This is internal and not intended for use.


iVal

private: TInt iVal;

Description

This is internal and not intended for use.


iMoreSpace

private: TInt iMoreSpace;

Description

This is internal and not intended for use.