|
|
|
Location:
e32des16.h
Link against: euser.lib
Link against: estor.lib
HBufC16
Supported from 5.0
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 intended for instantiation. The 16 bit data that the descriptor represents is part of the descriptor object itself.
Heap descriptors have the important property that they can be made larger or smaller, changing the size of the data area. 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 provides the functions through which the data is accessed.
|
Defined in HBufC16:
Des(), HBufC16(), New(), NewL(), NewL(), NewLC(), NewLC(), NewMax(), NewMaxL(), NewMaxLC(), ReAlloc(), ReAllocL(), iBuf, operator=()
Inherited from TDesC16:
Alloc(),
AllocL(),
AllocLC(),
Compare(),
CompareC(),
CompareF(),
Find(),
FindC(),
FindF(),
Left(),
Length(),
Locate(),
LocateF(),
LocateReverse(),
LocateReverseF(),
Match(),
MatchC(),
MatchF(),
Mid(),
Ptr(),
Right(),
Size(),
operator!=(),
operator<(),
operator<=(),
operator==(),
operator>(),
operator>=(),
operator[]()
static HBufC16* New(TInt aMaxLength);
Creates, and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length.
The heap descriptor is empty and its length is zero.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
static HBufC16* NewL(TInt aMaxLength);
Creates, and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length; leaves on failure.
The heap descriptor is empty and its length is zero.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
static HBufC16* NewL(RReadStream& aStream,TInt aMaxLength);
Creates, and returns a pointer to, a new 16 bit heap descriptor that has been initialised with data from the specified read stream; leaves on failure.
Data is assigned to the new descriptor from the specified stream. This variant assumes that the stream contains the length of the data followed by the data itself.
|
|
|
TCardinality object.static HBufC16* NewLC(TInt aMaxLength);
Creates, adds a pointer onto the cleanup stack and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length; leaves on failure.
The heap descriptor is empty and its length is zero.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
static HBufC16* NewLC(RReadStream &aStream,TInt aMaxLength);
Creates, adds a pointer onto the cleanup stack and returns a pointer to, a new 16 bit heap descriptor that has been initialised with data from the specified read stream; leaves on failure.
Data is assigned to the new descriptor from the specified stream. This variant assumes that the stream contains the length of the data followed by the data itself.
|
|
|
TCardinality object.static HBufC16* NewMax(TInt aMaxLength);
Creates, and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length.
No data is assigned into the new descriptor but its length is set to the same value as the specified maximum length.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
static HBufC16* NewMaxL(TInt aMaxLength);
Creates, and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length; leaves on failure.
No data is assigned into the new descriptor but its length is set to the same value as the specified maximum length.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
static HBufC16* NewMaxLC(TInt aMaxLength);
Creates, adds a pointer onto the cleanup stack and returns a pointer to, a new 16 bit heap descriptor that has the specified maximum length; leaves on failure.
No data is assigned into the new descriptor but its length is set to the same value as the specified maximum length.
Data can, subsequently, be assigned into it using the assignment operators.
|
|
HBufC16* ReAlloc(TInt aMaxLength);
Expands or contracts this 16 bit heap descriptor.
This is done by:
creating a new heap descriptor.
copying the original data into the new descriptor.
deleting the original descriptor.
|
|
HBufC16* ReAllocL(TInt aMaxLength);
Expands or contracts this 16 bit heap descriptor; leaves on failure.
This is done by:
creating a new heap descriptor.
copying the original data into the new descriptor.
deleting the original descriptor.
|
|
inline HBufC16& operator=(const HBufC16& aLcb);
HBufC16& operator=(const TDesC16& aDes);
HBufC16& operator=(const TUint16* aString);
Copies data into this 16 bit heap descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
TPtr16 Des();
Creates and returns a 16 bit modifiable pointer descriptor for the data represented by this 16 bit heap descriptor.
The content of a heap descriptor normally cannot be altered, other than by complete replacement of the data. Creating a modifiable pointer descriptor provides a way of changing the data.
The modifiable pointer descriptor is set to point to this heap descriptor's data.
The length of the modifiable pointer descriptor is set to the length of this heap descriptor.
The maximum length of the modifiable pointer descriptor is set to the length of the heap descriptor's data area.
When data is modified through this new pointer descriptor, the lengths of both it and this heap descriptor are changed.
Note that it is a common mistake to use Des() to
create a TDesC16& reference. While not incorrect, it is
simpler and much more efficient to simply dereference the heap
descriptor.
|
private : TText16 iBuf[1];
This is internal and is not intended for use.