CObexHeader Class Reference

#include <mw/obexheaders.h>

Link against: obex.lib

class CObexHeader : public CBase

Inherits from

  • CObexHeader
    Public Member Enumerations
    enumTHeaderAttr { ESuppressed, ESent, EDeleted }
    enumTHeaderType { EUnicode, EByteSeq, EByte, EFourByte }
    Public Member Functions
    virtual ~CObexHeader()
    IMPORT_C TUint8AsByte()
    IMPORT_C const TDesC8 &AsByteSeq()
    IMPORT_C TUint32AsFourByte()
    IMPORT_C const TDesC16 &AsUnicode()
    IMPORT_C TUint16Attributes()
    IMPORT_C CObexHeader *CopyL()
    IMPORT_C TIntEncodedSize()
    IMPORT_C TUint8HI()
    IMPORT_C CObexHeader *NewL()
    IMPORT_C voidReset()
    IMPORT_C voidResetContents()
    IMPORT_C voidSet(CObexHeader *)
    IMPORT_C voidSetAttributes(TUint16)
    IMPORT_C voidSetByte(const TUint8, const TUint8)
    IMPORT_C voidSetByteSeqL(const TUint8, const TDesC8 &)
    IMPORT_C voidSetFourByte(const TUint8, const TUint32)
    IMPORT_C voidSetUnicodeL(const TUint8, const TDesC16 &)
    IMPORT_C THeaderTypeType()
    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()

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

    See also: CObexBaseObject

    Member Enumeration Documentation

    Enum THeaderAttr

    EnumeratorValueDescription
    ESuppressed0x01
    ESent0x02
    EDeleted0x04

    Enum THeaderType

    EnumeratorValueDescription
    EUnicode0x00
    EByteSeq0x01
    EByte0x02
    EFourByte0x03

    Constructor & Destructor Documentation

    ~CObexHeader ( )

    ~CObexHeader()[virtual]

    Standard destructor.

    Member Function Documentation

    AsByte ( )

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

    Returns: The value of this header.

    AsByteSeq ( )

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

    Returns: The value of this header.

    AsFourByte ( )

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

    Returns: The value of this header.

    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.

    Returns: The value of this header.

    Attributes ( )

    IMPORT_C TUint16Attributes()const

    Return the attibute set currently in force.

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

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

    HI ( )

    IMPORT_C TUint8HI()const

    Returns the header identifier.

    NewL ( )

    IMPORT_C CObexHeader *NewL()[static]

    Reset ( )

    IMPORT_C voidReset()

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

    ResetContents ( )

    IMPORT_C voidResetContents()

    Resets and destroys all header attributes.

    Set ( CObexHeader * )

    IMPORT_C voidSet(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.

    SetAttributes ( TUint16 )

    IMPORT_C voidSetAttributes(TUint16aAttr)

    Sets the attibutes of this header.

    SetByte ( const TUint8, const TUint8 )

    IMPORT_C voidSetByte(const TUint8aHI,
    const TUint8aByte
    )

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

    SetByteSeqL ( const TUint8, const TDesC8 & )

    IMPORT_C voidSetByteSeqL(const TUint8aHI,
    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).

    SetFourByte ( const TUint8, const TUint32 )

    IMPORT_C voidSetFourByte(const TUint8aHI,
    const TUint32aFourByte
    )

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

    SetUnicodeL ( const TUint8, const TDesC16 & )

    IMPORT_C voidSetUnicodeL(const TUint8aHI,
    const TDesC16 &aUnicode
    )

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

    Type ( )

    IMPORT_C THeaderTypeType()const

    Return the type of this header.