class RBuf16 : public TDes16 |
16 bit resizable buffer descriptor.
The class provides a buffer that contains, accesses and manipulates TUint16 data. The buffer itself is on the heap, and is managed by the class.
Internally, RBuf16 behaves in one of two ways:
as a TPtr16 descriptor type, where the buffer just contains data
as a pointer to a heap descriptor, an HBufC16* type, where the buffer contains both descriptor information and the data.
Note that the handling of the distinction is hidden from view.
An RBuf16 object can allocate its own buffer. Alternatively, it can take ownership of a pre-existing section of allocated memory, or it can take ownership of a pre-existing heap descriptor. It can also reallocate the buffer to resize it. Regardless of the way in which the buffer has been allocated, the RBuf16 object is responsible for freeing memory when the object itself is closed.
The class is intended for instantiation.
The class is derived from TDes16, which means that data can be both accessed and modified. The base classes provide the functions through which the data is accessed. In addition, an RBuf16 object can be passed to any function that is prototyped to take a TDes16 or a TDesC16 type.
Public Member Functions | |
---|---|
RBuf16() | |
RBuf16(HBufC16 *) | |
IMPORT_C void | Assign(const RBuf16 &) |
IMPORT_C void | Assign(TUint16 *, TInt) |
IMPORT_C void | Assign(TUint16 *, TInt, TInt) |
IMPORT_C void | Assign(HBufC16 *) |
IMPORT_C void | CleanupClosePushL() |
IMPORT_C void | Close() |
IMPORT_C TInt | Create(TInt) |
IMPORT_C TInt | Create(const TDesC16 &) |
IMPORT_C TInt | Create(const TDesC16 &, TInt) |
IMPORT_C void | CreateL(TInt) |
void | CreateL(RReadStream &, TInt) |
IMPORT_C void | CreateL(const TDesC16 &) |
IMPORT_C void | CreateL(const TDesC16 &, TInt) |
IMPORT_C TInt | CreateMax(TInt) |
IMPORT_C void | CreateMaxL(TInt) |
IMPORT_C TInt | ReAlloc(TInt) |
IMPORT_C void | ReAllocL(TInt) |
IMPORT_C void | Swap(RBuf16 &) |
RBuf16 & | operator=(const TUint16 *) |
RBuf16 & | operator=(const TDesC16 &) |
RBuf16 & | operator=(const RBuf16 &) |
Protected Member Functions | |
---|---|
RBuf16(TInt, TInt, TInt) | |
RBuf16(const RBuf16 &) |
Inherited Enumerations | |
---|---|
TDesC16:TPrefix |
Public Attributes | |
---|---|
HBufC16 * | iEBufCPtrType |
TUint16 * | iEPtrType |
Protected Attributes | |
---|---|
union RBuf16::@9 | @10 |
__DECLARE_TEST |
Inherited Attributes | |
---|---|
TDes16::iMaxLength |
void | CreateL | ( | RReadStream & | aStream, |
TInt | aMaxLength | |||
) | [inline] |
Creates a 16-bit resizable buffer 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.
The function is implemented by calling the HBufC16::NewL(RReadStream&,TInt) variant and then assigning the resulting heap descriptor using the RBuf16::Assign(HBufC16*) variant. The comments that describe the HBufC16::NewL() variant also apply to this RBuf16::CreateL() function.
The function may leave with one of the system-wide error codes, specifically KErrOverflow, if the length of the data as read from the stream is greater than the upper limit as specified by the aMaxLength parameter.
RReadStream & aStream | The stream from which the data length and the data to be assigned to the new descriptor, are taken. |
TInt aMaxLength | The upper limit on the length of data that the descriptor is to represent. The value of this parameter must be non-negative otherwise the underlying function will panic. |
RBuf16 & | operator= | ( | const TUint16 * | aString | ) | [inline] |
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
A reference to this, the target descriptor.
panic
USER 11, if the length of the string, excluding the zero terminator, is greater than the maximum length of this (target) descriptor.
const TUint16 * aString | A pointer to a zero-terminated string. |
RBuf16 & | operator= | ( | const TDesC16 & | aDes | ) | [inline] |
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
A reference to this, the target descriptor.
panic
USER 11, if the length of the descriptor aDes is greater than the maximum length of this (target) descriptor.
const TDesC16 & aDes | A 16-bit non-modifiable descriptor. |
RBuf16 & | operator= | ( | const RBuf16 & | aDes | ) | [inline] |
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
A reference to this, the target descriptor.
panic
USER 11, if the length of the descriptor aDes is greater than the maximum length of this (target) descriptor.
const RBuf16 & aDes | A 16-bit buffer descriptor. |