Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <obexheaders.h>
Link against: obex.lib

Class CObexHeader

class CObexHeader : public CBase;

Description

Encapsulates an Obex header.

This class provides the ability to hold a header of any of the Obex supported types as a native Symbian OS type.

A header may also have one or more attributes set. These are used by the object which owns the header collection so that it can keep track of which headers should be sent (!(ESuppressed || EDeleted)), which have been sent (ESent), and whether the header should be deleted (EDeleted). Deletion is a special case---any operation on the Object which causes a scan of the headers will trigger deletion of any marked headers. This is required as they are owned by the Object, but can be accessed seperately (including through the creator keeping a pointer to the header).

Derivation

Members

Defined in CObexHeader:

Inherited from CBase:

See also:


Construction and destruction


NewL()

IMPORT_C static CObexHeader* NewL();

Description

Return value

CObexHeader *


~CObexHeader()

virtual ~CObexHeader();

Description

Standard destructor.

[Top]


Member functions


CopyL()const

IMPORT_C CObexHeader* CopyL() const;

Description

Return a pointer to a copy of this object. This must be used instead of merely copying the pointer to the initial CObexHeader object as reference counting is used to keep track of instances of the header. The underlying data is not cloned, so any change to the data pointed to by this pointer could change the underlying data.

Return value

CObexHeader *


Set(CObexHeader *)

IMPORT_C void Set(CObexHeader *aHeader);

Description

Sets this object to use the same underlying header as the parameter. This performs essentially the same function as the CObexHeader::CopyL()const function, but does not allocate a new object. The underlying data is not cloned, so any change to the data pointed to by this pointer could change the underlying data.

Parameters

CObexHeader *aHeader


Reset()

IMPORT_C void Reset();

Description

Resets the contents of this header, discarding the underlying data. This is only called by the last instance of the header.


ResetContents()

IMPORT_C void ResetContents();

Description

Resets and destroys all header attributes.


SetAttributes(TUint16)

IMPORT_C void SetAttributes(TUint16 aAttr);

Description

Sets the attibutes of this header.

Parameters

TUint16 aAttr


Attributes()const

IMPORT_C TUint16 Attributes() const;

Description

Return the attibute set currently in force.

Return value

TUint16


Type()const

IMPORT_C THeaderType Type() const;

Description

Return the type of this header.

Return value

CObexHeader::THeaderType


HI()const

IMPORT_C TUint8 HI() const;

Description

Returns the header identifier.

Return value

TUint8


AsByte()const

IMPORT_C TUint8 AsByte() const;

Description

Returns this header as a byte value.

Return value

TUint8

The value of this header.

Panic codes

Obex

EHeaderAsBadType Panics builds if header is of incorrect type.


AsFourByte()const

IMPORT_C TUint32 AsFourByte() const;

Description

Returns this header as a four-byte value.

Return value

TUint32

The value of this header.

Panic codes

Obex

EHeaderAsBadType Panics if header is of incorrect type.


AsByteSeq()const

IMPORT_C const TDesC8& AsByteSeq() const;

Description

Returns this header as a byte sequence.

Return value

const TDesC8 &

The value of this header.

Panic codes

Obex

EHeaderAsBadType Panics if header is of incorrect type.


AsUnicode()const

IMPORT_C const TDesC16& AsUnicode() const;

Description

Returns this header as an Unicode string.

Return value

const TDesC16 &

The value of this header.

Panic codes

Obex

EHeaderAsBadType Panics in debug builds if header is of incorrect type.


SetByte(const TUint8,const TUint8)

IMPORT_C void SetByte(const TUint8 aHI, const TUint8 aByte);

Description

Sets this header to represent a byte value. Forces header type to be a byte (which may therefore change the HI value).

Parameters

const TUint8 aHI

const TUint8 aByte


SetFourByte(const TUint8,const TUint32)

IMPORT_C void SetFourByte(const TUint8 aHI, const TUint32 aFourByte);

Description

Sets this header to represent a four-byte value. Forces header type to be a four-byte (which may therefore change the HI value).

Parameters

const TUint8 aHI

const TUint32 aFourByte


SetByteSeqL(const TUint8,const TDesC8 &)

IMPORT_C void SetByteSeqL(const TUint8 aHI, const TDesC8 &aByteSeq);

Description

Sets this header to represent a byte sequence. Forces header type to be a byte sequence (which may therefore change the HI value).

Parameters

const TUint8 aHI

const TDesC8 &aByteSeq


SetUnicodeL(const TUint8,const TDesC16 &)

IMPORT_C void SetUnicodeL(const TUint8 aHI, const TDesC16 &aUnicode);

Description

Forces header type to be a byte (which may therefore change the HI value).

Parameters

const TUint8 aHI

const TDesC16 &aUnicode


EncodedSize()const

IMPORT_C TInt EncodedSize() const;

Description

Return value

TInt

The encoded size of this header in bytes, including the HI byte and the HV body.

[Top]


Member enumerations


Enum THeaderType

THeaderType

Description

EUnicode

EByteSeq

EByte

EFourByte


Enum THeaderAttr

THeaderAttr

Description

ESuppressed

ESent

EDeleted