CObexHeader Class Reference

class CObexHeader : public CBase

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

CObexBaseObject

Inherits from

Public Member Functions
~CObexHeader ()
IMPORT_C TUint8 AsByte ()
IMPORT_C const TDesC8 & AsByteSeq ()
IMPORT_C TUint32 AsFourByte ()
IMPORT_C const TDesC16 & AsUnicode ()
IMPORT_C TUint16 Attributes ()
IMPORT_C CObexHeader * CopyL ()
IMPORT_C TInt EncodedSize ()
IMPORT_C TUint8 HI ()
IMPORT_C CObexHeader * NewL ()
IMPORT_C void Reset ()
IMPORT_C void ResetContents ()
IMPORT_C void Set ( CObexHeader *)
IMPORT_C void SetAttributes ( TUint16 )
IMPORT_C void SetByte (const TUint8 , const TUint8 )
IMPORT_C void SetByteSeqL (const TUint8 , const TDesC8 &)
IMPORT_C void SetFourByte (const TUint8 , const TUint32 )
IMPORT_C void SetUnicodeL (const TUint8 , const TDesC16 &)
IMPORT_C THeaderType Type ()
Private Member Functions
CObexHeader ()
CObexHeader (CObexUnderlyingHeader *)
void ConstructL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum THeaderAttr { ESuppressed  = 0x01, ESent  = 0x02, EDeleted  = 0x04 }
enum THeaderType { EUnicode  = 0x00, EByteSeq  = 0x01, EByte  = 0x02, EFourByte  = 0x03 }
Private Attributes
CObexUnderlyingHeader * iHeader

Constructor & Destructor Documentation

CObexHeader()

CObexHeader ( ) [private]

Standard constructor.

CObexHeaderSet

CObexHeader(CObexUnderlyingHeader *)

CObexHeader ( CObexUnderlyingHeader * aHeader ) [private]

Standard constructor, taking a pointer to an underlying object.

Parameters

CObexUnderlyingHeader * aHeader

~CObexHeader()

~CObexHeader ( ) [virtual]

Standard destructor.

Member Functions Documentation

AsByte()

IMPORT_C TUint8 AsByte ( ) const
Returns this header as a byte value.
panic
Obex EHeaderAsBadType Panics builds if header is of incorrect type.

AsByteSeq()

IMPORT_C const TDesC8 & AsByteSeq ( ) const
Returns this header as a byte sequence.
panic
Obex EHeaderAsBadType Panics if header is of incorrect type.

AsFourByte()

IMPORT_C TUint32 AsFourByte ( ) const
Returns this header as a four-byte value.
panic
Obex EHeaderAsBadType Panics if header is of incorrect type.

AsUnicode()

IMPORT_C const TDesC16 & AsUnicode ( ) const
Returns this header as an Unicode string.
panic
Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.

Attributes()

IMPORT_C TUint16 Attributes ( ) const

Return the attibute set currently in force.

ConstructL()

void ConstructL ( ) [private]

Phase two constructor. Create the underlying header object. This is reference counted so ownership passes to itself.

CopyL()

IMPORT_C CObexHeader * CopyL ( ) const

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.

EncodedSize()

IMPORT_C TInt EncodedSize ( ) const

HI()

IMPORT_C TUint8 HI ( ) const

Returns the header identifier.

NewL()

IMPORT_C CObexHeader * NewL ( ) [static]

Reset()

IMPORT_C void Reset ( )

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

Resets and destroys all header attributes.

Set(CObexHeader *)

IMPORT_C void Set ( CObexHeader * aHeader )

Sets this object to use the same underlying header as the parameter. This performs essentially the same function as the CopyL() 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

SetAttributes(TUint16)

IMPORT_C void SetAttributes ( TUint16 aAttr )

Sets the attibutes of this header.

Parameters

TUint16 aAttr

SetByte(const TUint8, const TUint8)

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

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

SetByteSeqL(const TUint8, const TDesC8 &)

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

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

SetFourByte(const TUint8, const TUint32)

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

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

SetUnicodeL(const TUint8, const TDesC16 &)

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

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

Parameters

const TUint8 aHI
const TDesC16 & aUnicode

Type()

IMPORT_C THeaderType Type ( ) const

Return the type of this header.

Member Enumerations Documentation

Enum THeaderAttr

Enumerators

ESuppressed = 0x01
ESent = 0x02
EDeleted = 0x04

Enum THeaderType

Enumerators

EUnicode = 0x00
EByteSeq = 0x01
EByte = 0x02
EFourByte = 0x03

Member Data Documentation

CObexUnderlyingHeader * iHeader

CObexUnderlyingHeader * iHeader [private]