HBufC16 Class Reference

class HBufC16 : public TBufCBase16

16-bit heap descriptor.

This is a descriptor class which provides a buffer of fixed length, allocated on the heap, for containing and accessing data.

The class is intended for instantiation.

Heap descriptors have the important property that they can be made larger or smaller, changing the size of the descriptor buffer. This is achieved by reallocating the descriptor. Unlike the behaviour of dynamic buffers, reallocation is not done automatically.

Data is intended to be accessed, but not modified; however, it can be completely replaced using the assignment operators of this class. The base class (TDesC16) provides the functions through which the data is accessed.

The descriptor is hosted by a heap cell, and the 16-bit data that the descriptor represents is part of the descriptor object itself. The size of the cell depends on the requested maximum length of the descriptor buffer when the descriptor is created or re-allocated.

It is important to note that the size of the allocated cell, and, therefore, the resulting maximum length of the descriptor, may be larger than requested due to the way memory is allocated in Symbian OS. The amount by which this may be rounded up depends on the platform and build type.

HBufC

TPtr16

TDesC16

Inherits from

Public Member Functions
IMPORT_C TPtr16Des()
IMPORT_C HBufC16 *New(TInt)
IMPORT_C HBufC16 *NewL(TInt)
IMPORT_C HBufC16 *NewL(RReadStream &, TInt)
IMPORT_C HBufC16 *NewLC(TInt)
IMPORT_C HBufC16 *NewLC(RReadStream &, TInt)
IMPORT_C HBufC16 *NewMax(TInt)
IMPORT_C HBufC16 *NewMaxL(TInt)
IMPORT_C HBufC16 *NewMaxLC(TInt)
IMPORT_C HBufC16 *ReAlloc(TInt)
IMPORT_C HBufC16 *ReAllocL(TInt)
IMPORT_C HBufC16 &operator=(const TUint16 *)
IMPORT_C HBufC16 &operator=(const TDesC16 &)
HBufC16 &operator=(const HBufC16 &)
Private Member Functions
HBufC16(TInt)
Inherited Functions
TBufCBase16::Copy(const TDesC16 &,TInt)
TBufCBase16::Copy(const TUint16 *,TInt)
TBufCBase16::DoDes(TInt)
TBufCBase16::TBufCBase16()
TBufCBase16::TBufCBase16(TInt)
TBufCBase16::TBufCBase16(const TDesC16 &,TInt)
TBufCBase16::TBufCBase16(const TUint16 *,TInt)
TBufCBase16::WPtr()const
TDesC16::Alloc()const
TDesC16::AllocL()const
TDesC16::AllocLC()const
TDesC16::AtC(TInt)const
TDesC16::Compare(const TDesC16 &)const
TDesC16::CompareC(const TDesC16 &)const
TDesC16::CompareC(const TDesC16 &,TInt,const TCollationMethod *)const
TDesC16::CompareF(const TDesC16 &)const
TDesC16::DoSetLength(TInt)
TDesC16::Find(const TDesC16 &)const
TDesC16::Find(const TUint16 *,TInt)const
TDesC16::FindC(const TDesC16 &)const
TDesC16::FindC(const TDesC16 &,TInt &,const TCollationMethod &,TInt)const
TDesC16::FindC(const TUint16 *,TInt)const
TDesC16::FindC(const TUint16 *,TInt,TInt)const
TDesC16::FindF(const TDesC16 &)const
TDesC16::FindF(const TUint16 *,TInt)const
TDesC16::GetCollationKeysL(TInt,const TCollationMethod *)const
TDesC16::GetFoldedDecomposedFormL()const
TDesC16::GetNormalizedDecomposedFormL()const
TDesC16::HasPrefixC(const TDesC16 &,TInt,const TCollationMethod *)const
TDesC16::Left(TInt)const
TDesC16::Length()const
TDesC16::Locate(TChar)const
TDesC16::LocateF(TChar)const
TDesC16::LocateReverse(TChar)const
TDesC16::LocateReverseF(TChar)const
TDesC16::Match(const TDesC16 &)const
TDesC16::MatchC(const TDesC16 &)const
TDesC16::MatchC(const TDesC16 &,TInt,TInt,TInt,TInt,const TCollationMethod *)const
TDesC16::MatchC(const TDesC16 &,const TCollationMethod *,TInt,TInt,TInt,TInt)const
TDesC16::MatchF(const TDesC16 &)const
TDesC16::Mid(TInt)const
TDesC16::Mid(TInt,TInt)const
TDesC16::Ptr()const
TDesC16::Right(TInt)const
TDesC16::Size()const
TDesC16::TDesC16()
TDesC16::TDesC16(TInt,TInt)
TDesC16::Type()const
TDesC16::operator!=(const TDesC16 &)const
TDesC16::operator<(const TDesC16 &)const
TDesC16::operator<=(const TDesC16 &)const
TDesC16::operator==(const TDesC16 &)const
TDesC16::operator>(const TDesC16 &)const
TDesC16::operator>=(const TDesC16 &)const
TDesC16::operator[](TInt)const
Inherited Enumerations
TDesC16:TPrefix
Private Attributes
__DECLARE_TEST
TText16 iBuf

Constructor & Destructor Documentation

HBufC16(TInt)

HBufC16(TIntaLength)[private, inline]

Parameters

TInt aLength

Member Functions Documentation

Des()

IMPORT_C TPtr16Des()

New(TInt)

IMPORT_C HBufC16 *New(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

NewL(TInt)

IMPORT_C HBufC16 *NewL(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

NewL(RReadStream &, TInt)

IMPORT_C HBufC16 *NewL(RReadStream &aStream,
TIntaMaxLength
)[static]

Parameters

RReadStream & aStream
TInt aMaxLength

NewLC(TInt)

IMPORT_C HBufC16 *NewLC(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

NewLC(RReadStream &, TInt)

IMPORT_C HBufC16 *NewLC(RReadStream &aStream,
TIntaMaxLength
)[static]

Parameters

RReadStream & aStream
TInt aMaxLength

NewMax(TInt)

IMPORT_C HBufC16 *NewMax(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

NewMaxL(TInt)

IMPORT_C HBufC16 *NewMaxL(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

NewMaxLC(TInt)

IMPORT_C HBufC16 *NewMaxLC(TIntaMaxLength)[static]

Parameters

TInt aMaxLength

ReAlloc(TInt)

IMPORT_C HBufC16 *ReAlloc(TIntaMaxLength)

Parameters

TInt aMaxLength

ReAllocL(TInt)

IMPORT_C HBufC16 *ReAllocL(TIntaMaxLength)

Parameters

TInt aMaxLength

operator=(const TUint16 *)

IMPORT_C HBufC16 &operator=(const TUint16 *aString)

Parameters

const TUint16 * aString

operator=(const TDesC16 &)

IMPORT_C HBufC16 &operator=(const TDesC16 &aDes)

Parameters

const TDesC16 & aDes

operator=(const HBufC16 &)

HBufC16 &operator=(const HBufC16 &aLcb)[inline]

Copies data into this 16-bit heap descriptor replacing any existing data.

The length of this descriptor is set to reflect the new data.

Note that the maximum length of this (target) descriptor is the length of the descriptor buffer in the allocated host heap cell; this may be greater than the maximum length specified when this descriptor was created or last re-allocated.

A reference to this 16-bit heap descriptor.

panic

USER 11, if the length of the descriptor aLcb is greater than the maximum length of this (target) descriptor

Parameters

const HBufC16 & aLcbThe source 16-bit heap descriptor.

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

TText16 iBuf

TText16 iBuf[private]