class RBuf8 : public TDes8 |
8 bit resizable buffer descriptor.
The class provides a buffer that contains, accesses and manipulates TUint8 data. The buffer itself is on the heap, and is managed by the class.
Internally, RBuf8 behaves in one of two ways:
as a TPtr8 descriptor type, where the buffer just contains data
as a pointer to a heap descriptor, an HBufC8* type, where the buffer contains both descriptor information and the data.
Note that the handling of the distinction is hidden from view.
An RBuf8 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 RBuf8 object is responsible for freeing memory when the object itself is closed.
The class is intended for instantiation.
The class is derived from TDes8, 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 RBuf8 object can be passed to any function that is prototyped to take a TDes8 or a TDesC8 type.
Public Member Functions | |
---|---|
RBuf8() | |
RBuf8(HBufC8 *) | |
IMPORT_C void | Assign(const RBuf8 &) |
IMPORT_C void | Assign(TUint8 *, TInt) |
IMPORT_C void | Assign(TUint8 *, TInt, TInt) |
IMPORT_C void | Assign(HBufC8 *) |
IMPORT_C void | CleanupClosePushL() |
IMPORT_C void | Close() |
IMPORT_C TInt | Create(TInt) |
IMPORT_C TInt | Create(const TDesC8 &) |
IMPORT_C TInt | Create(const TDesC8 &, TInt) |
IMPORT_C void | CreateL(TInt) |
void | CreateL(RReadStream &, TInt) |
IMPORT_C void | CreateL(const TDesC8 &) |
IMPORT_C void | CreateL(const TDesC8 &, 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(RBuf8 &) |
RBuf8 & | operator=(const TUint8 *) |
RBuf8 & | operator=(const TDesC8 &) |
RBuf8 & | operator=(const RBuf8 &) |
Protected Member Functions | |
---|---|
RBuf8(TInt, TInt, TInt) | |
RBuf8(const RBuf8 &) |
Public Attributes | |
---|---|
HBufC8 * | iEBufCPtrType |
TUint8 * | iEPtrType |
Protected Attributes | |
---|---|
union RBuf8::@7 | @8 |
__DECLARE_TEST |
Inherited Attributes | |
---|---|
TDes8::iMaxLength |
void | CreateL | ( | RReadStream & | aStream, |
TInt | aMaxLength | |||
) | [inline] |
Creates an 8-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 HBufC8::NewL(RReadStream&,TInt) variant and then assigning the resulting heap descriptor using the RBuf8::Assign(HBufC8*) variant. The comments that describe the HBufC8::NewL() variant also apply to this RBuf8::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. |
RBuf8 & | operator= | ( | const TUint8 * | 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 TUint8 * aString | A pointer to a zero-terminated string. |
RBuf8 & | operator= | ( | const TDesC8 & | 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 TDesC8 & aDes | An 8-bit non-modifiable descriptor. |
RBuf8 & | operator= | ( | const RBuf8 & | 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 RBuf8 & aDes | A 8-bit buffer descriptor. |