TDesC8 Class Reference

class TDesC8

Abstract base class for 8-bit non-modifiable descriptors.

The class encapsulates the data member containing the length of data represented by an 8-bit descriptor. It also provides member functions through which the data can be accessed, but not modified.

Data represented by this class is treated as a contiguous set of 8-bit (i.e. single byte) values or data items.

This class cannot be instantiated as it is intended to form part of a class hierarchy; it provides a well defined part of descriptor behaviour. It can, however, be passed as an argument type for functions which want access to descriptor data but do not need to modify that data.

TDesC

TPtrC8

Public Member Functions
IMPORT_C HBufC8 *Alloc()
IMPORT_C HBufC8 *AllocL()
IMPORT_C HBufC8 *AllocLC()
IMPORT_C TIntCompare(const TDesC8 &)
IMPORT_C TIntCompareC(const TDesC8 &)
IMPORT_C TIntCompareF(const TDesC8 &)
IMPORT_C TIntFind(const TDesC8 &)
IMPORT_C TIntFind(const TUint8 *, TInt)
IMPORT_C TIntFindC(const TDesC8 &)
IMPORT_C TIntFindC(const TUint8 *, TInt)
IMPORT_C TIntFindF(const TDesC8 &)
IMPORT_C TIntFindF(const TUint8 *, TInt)
IMPORT_C TPtrC8Left(TInt)
TInt Length()
IMPORT_C TIntLocate(TChar)
IMPORT_C TIntLocateF(TChar)
IMPORT_C TIntLocateReverse(TChar)
IMPORT_C TIntLocateReverseF(TChar)
IMPORT_C TIntMatch(const TDesC8 &)
IMPORT_C TIntMatchC(const TDesC8 &)
IMPORT_C TIntMatchF(const TDesC8 &)
IMPORT_C TPtrC8Mid(TInt)
IMPORT_C TPtrC8Mid(TInt, TInt)
IMPORT_C const TUint8 *Ptr()
IMPORT_C TPtrC8Right(TInt)
TInt Size()
TBool operator!=(const TDesC8 &)
TBool operator<(const TDesC8 &)
TBool operator<=(const TDesC8 &)
TBool operator==(const TDesC8 &)
TBool operator>(const TDesC8 &)
TBool operator>=(const TDesC8 &)
const TUint8 &operator[](TInt)
Protected Member Functions
TDesC8(TInt, TInt)
TDesC8()
IMPORT_C const TUint8 &AtC(TInt)
voidDoSetLength(TInt)
TInt Type()
Private Attributes
__DECLARE_TEST
TUint iLength

Constructor & Destructor Documentation

TDesC8(TInt, TInt)

TDesC8(TIntaType,
TIntaLength
)[protected, inline]

Parameters

TInt aType
TInt aLength

TDesC8()

TDesC8()[protected, inline]

Member Functions Documentation

Alloc()

IMPORT_C HBufC8 *Alloc()const

AllocL()

IMPORT_C HBufC8 *AllocL()const

AllocLC()

IMPORT_C HBufC8 *AllocLC()const

AtC(TInt)

IMPORT_C const TUint8 &AtC(TIntanIndex)const [protected]

Parameters

TInt anIndex

Compare(const TDesC8 &)

IMPORT_C TIntCompare(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

CompareC(const TDesC8 &)

IMPORT_C TIntCompareC(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

CompareF(const TDesC8 &)

IMPORT_C TIntCompareF(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

DoSetLength(TInt)

voidDoSetLength(TIntaLength)[protected, inline]

Parameters

TInt aLength

Find(const TDesC8 &)

IMPORT_C TIntFind(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

Find(const TUint8 *, TInt)

IMPORT_C TIntFind(const TUint8 *pS,
TIntaLenS
)const

Parameters

const TUint8 * pS
TInt aLenS

FindC(const TDesC8 &)

IMPORT_C TIntFindC(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

FindC(const TUint8 *, TInt)

IMPORT_C TIntFindC(const TUint8 *pS,
TIntaLenS
)const

Parameters

const TUint8 * pS
TInt aLenS

FindF(const TDesC8 &)

IMPORT_C TIntFindF(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

FindF(const TUint8 *, TInt)

IMPORT_C TIntFindF(const TUint8 *pS,
TIntaLenS
)const

Parameters

const TUint8 * pS
TInt aLenS

Left(TInt)

IMPORT_C TPtrC8Left(TIntaLength)const

Parameters

TInt aLength

Length()

TInt Length()const [inline]

Gets the length of the data.

This is the number of 8-bit values or data items represented by the descriptor.

The length of the data represented by the descriptor.

Locate(TChar)

IMPORT_C TIntLocate(TCharaChar)const

Parameters

TChar aChar

LocateF(TChar)

IMPORT_C TIntLocateF(TCharaChar)const

Parameters

TChar aChar

LocateReverse(TChar)

IMPORT_C TIntLocateReverse(TCharaChar)const

Parameters

TChar aChar

LocateReverseF(TChar)

IMPORT_C TIntLocateReverseF(TCharaChar)const

Parameters

TChar aChar

Match(const TDesC8 &)

IMPORT_C TIntMatch(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

MatchC(const TDesC8 &)

IMPORT_C TIntMatchC(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

MatchF(const TDesC8 &)

IMPORT_C TIntMatchF(const TDesC8 &aDes)const

Parameters

const TDesC8 & aDes

Mid(TInt)

IMPORT_C TPtrC8Mid(TIntaPos)const

Parameters

TInt aPos

Mid(TInt, TInt)

IMPORT_C TPtrC8Mid(TIntaPos,
TIntaLength
)const

Parameters

TInt aPos
TInt aLength

Ptr()

IMPORT_C const TUint8 *Ptr()const

Right(TInt)

IMPORT_C TPtrC8Right(TIntaLength)const

Parameters

TInt aLength

Size()

TInt Size()const [inline]

Gets the size of the data.

This is the number of bytes occupied by the data represented by the descriptor.

The size of the data represented by the descriptor.

Type()

TInt Type()const [protected, inline]

operator!=(const TDesC8 &)

TBool operator!=(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is not equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if not equal, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator<(const TDesC8 &)

TBool operator<(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is less than the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if greater than or equal, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator<=(const TDesC8 &)

TBool operator<=(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is less than or equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if less than or equal, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator==(const TDesC8 &)

TBool operator==(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if equal, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator>(const TDesC8 &)

TBool operator>(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is greater than the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if greater than, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator>=(const TDesC8 &)

TBool operator>=(const TDesC8 &aDes)const [inline]

Determines whether this descriptor's data is greater than or equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if greater than, false otherwise.

TDesC8::Compare

Parameters

const TDesC8 & aDesThe 8-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator[](TInt)

const TUint8 &operator[](TIntanIndex)const [inline]

Gets a reference to a single data item within this descriptor's data.

A reference to the data item.

panic

USER 21, if anIndex is negative or greater than or equal to the current length of the descriptor.

Parameters

TInt anIndexThe position of the individual data item within the descriptor's data. This is an offset value; a zero value refers to the leftmost data position.

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

TUint iLength

TUint iLength[private]