|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Defines the interface for dynamic buffers. More...
#include <e32base.h>
Public Member Functions | |
| IMPORT_C | ~CBufBase () |
| Destructor. | |
| TInt | Size () const |
| Gets the number of data bytes in the buffer. | |
| IMPORT_C void | Reset () |
| Deletes all data in the buffer. | |
| IMPORT_C void | Read (TInt aPos, TDes8 &aDes) const |
| Reads data from the buffer into a descriptor. | |
| IMPORT_C void | Read (TInt aPos, TDes8 &aDes, TInt aLength) const |
| Reads the specified number of bytes of data from the buffer into a descriptor. | |
| IMPORT_C void | Read (TInt aPos, TAny *aPtr, TInt aLength) const |
| Reads the specified number of bytes of data from the buffer into a specified address. | |
| IMPORT_C void | Write (TInt aPos, const TDesC8 &aDes) |
| Writes data from a descriptor to the buffer. | |
| IMPORT_C void | Write (TInt aPos, const TDesC8 &aDes, TInt aLength) |
| Writes the specified number of bytes of data from a descriptor to the buffer. | |
| IMPORT_C void | Write (TInt aPos, const TAny *aPtr, TInt aLength) |
| Writes the specified number of bytes of data from the specified address to the buffer. | |
| IMPORT_C void | InsertL (TInt aPos, const TDesC8 &aDes) |
| Inserts data into the buffer. | |
| IMPORT_C void | InsertL (TInt aPos, const TDesC8 &aDes, TInt aLength) |
| Inserts the specified number of bytes of data from a descriptor into the buffer. | |
| IMPORT_C void | InsertL (TInt aPos, const TAny *aPtr, TInt aLength) |
| Inserts bytes of data from the specified address into the buffer. | |
| IMPORT_C void | ExpandL (TInt aPos, TInt aLength) |
| Inserts an uninitialised region into the buffer. | |
| IMPORT_C void | ResizeL (TInt aSize) |
| Re-sizes the buffer to the specified size. | |
| virtual void | Compress ()=0 |
| Compresses the buffer so as to occupy minimal space. | |
| virtual void | Delete (TInt aPos, TInt aLength)=0 |
| Deletes data from the buffer. | |
| virtual TPtr8 | Ptr (TInt aPos)=0 |
| Gets a pointer descriptor to represent the data from the specified position to the end of the contiguous region containing that byte. | |
| virtual TPtr8 | BackPtr (TInt aPos)=0 |
| Gets a pointer descriptor to represent data from just before the specified data byte backward to the beginning of the contiguous region containing that byte. | |
Public Member Functions inherited from CBase | |
| CBase () | |
| Default constructor. | |
| virtual IMPORT_C | ~CBase () |
| Virtual destructor. | |
| TAny * | operator new (TUint aSize, TAny *aBase) __NO_THROW |
| Initialises the object to binary zeroes. | |
| TAny * | operator new (TUint aSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TUint aExtraSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave, TUint aExtraSize) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
Protected Member Functions | |
| IMPORT_C | CBufBase (TInt anExpandSize) |
| Constructor. | |
Protected Member Functions inherited from CBase | |
| virtual IMPORT_C TInt | Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1) |
| Extension function. | |
Protected Attributes | |
| TInt | iSize |
| TInt | iExpandSize |
Additional Inherited Members | |
Static Public Member Functions inherited from CBase | |
| static IMPORT_C void | Delete (CBase *aPtr) |
| Deletes the specified object. | |
Defines the interface for dynamic buffers.
The basic functions, InsertL(), Read(), Write(), Delete(), Reset() and Size(), transfer data between the buffer and other places, and allow that data to be deleted
The ExpandL() and Resize() functions allow some operations to be carried out with greater efficiency
A Compress() function frees (back to the heap) any space which may have been allocated, but not used
Ptr() and BackPtr() allow look-up of contiguous data from any given position, forward or backward
| IMPORT_C CBufBase::~CBufBase | ( | ) |
Destructor.
(generated from Symbian Developer Library)
|
protected |
Constructor.
(generated from Original Symbian implementation)
|
pure virtual |
Gets a pointer descriptor to represent data from just before the specified data byte backward to the beginning of the contiguous region containing that byte.
Derived classes provide the implementation.
| aPos | Buffer position: must be in range zero to Size(). |
|
pure virtual |
Compresses the buffer so as to occupy minimal space.
Normally, you would call this when a buffer has reached its final size, or when you know it will not expand again for a while, or when an out-of-memory error has occurred and your program is taking measures to save space. Compression in these circumstances releases memory for other programs to use, but has no adverse effect on performance.
Derived classes provide the implementation.
|
pure virtual |
Deletes data from the buffer.
Derived classes provide the implementation.
| aPos | Buffer position where the deletion will begin; must be in the range zero to (Size() minus the length of the data to be deleted). |
| aLength | The number of bytes to be deleted; must be non-negative. |
| IMPORT_C void CBufBase::ExpandL | ( | TInt | aPos, |
| TInt | aLength | ||
| ) |
Inserts an uninitialised region into the buffer.
Data at and beyond the insertion position is moved to make way for the inserted region. Data before the insertion position remains in place.
Note:
| aPos | Buffer position before which the region will be inserted; must be in range zero to Size(). |
| aLength | The length of the region to be inserted. |
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::InsertL | ( | TInt | aPos, |
| const TAny * | aPtr, | ||
| TInt | aLength | ||
| ) |
Inserts bytes of data from the specified address into the buffer.
Inserts aLength bytes of data found at address aPtr into the buffer at aPos. Data at and beyond the insertion position is moved to make way for the inserted data. Data before the insertion position remains in place.
Notes:
| aPos | Buffer position before which the data will be inserted: must be in range zero to Size(). |
| aPtr | The address of the data to be inserted. |
| aLength | The length of the data to be inserted. |
Leave condition: KErrNoMemory If the insertion requires a bigger buffer, and the necessary allocation or re-allocation fails.
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::InsertL | ( | TInt | aPos, |
| const TDesC8 & | aDes | ||
| ) |
Inserts data into the buffer.
Data at and beyond the insertion position is moved to make way for the inserted data. Data before the insertion position remains in place.
Notes:
| aPos | Buffer position before which the data will be inserted; must be in range zero to Size(). |
| aDes | The data to be inserted; the length of the data is the descriptor length. |
Leave condition: KErrNoMemory If the insertion requires a bigger buffer, and the necessary allocation or re-allocation fails.
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::InsertL | ( | TInt | aPos, |
| const TDesC8 & | aDes, | ||
| TInt | aLength | ||
| ) |
Inserts the specified number of bytes of data from a descriptor into the buffer.
aLength bytes of data from aDes are inserted into the buffer at aPos. Data at and beyond the insertion position is moved to make way for the inserted data. Data before the insertion position remains in place.
Notes:
| aPos | Buffer position before which the data will be inserted; must be in range zero to Size(). |
| aDes | The data to be inserted. |
| aLength | The length of data to be inserted. |
Leave condition: KErrNoMemory If the insertion requires a bigger buffer, and the necessary allocation or re-allocation fails.
(generated from Symbian Developer Library)
|
pure virtual |
Gets a pointer descriptor to represent the data from the specified position to
the end of the contiguous region containing that byte.
Derived classes provide the implementation.
| aPos | Buffer position: must be in range zero to Size(). |
| IMPORT_C void CBufBase::Read | ( | TInt | aPos, |
| TAny * | aPtr, | ||
| TInt | aLength | ||
| ) | const |
Reads the specified number of bytes of data from the buffer into a specified address.
| aPos | Buffer position from which data is read: must be in range zero to (Size() minus the length of the data to be read). |
| aPtr | The address into which the data should be read. |
| aLength | The length of the data to be read. |
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Read | ( | TInt | aPos, |
| TDes8 & | aDes | ||
| ) | const |
Reads data from the buffer into a descriptor.
Data, starting at the specified buffer position is written to the descriptor, filling the descriptor.
| aPos | Buffer position from which data is read: must be in range zero to Size(). |
| aDes | On return, contains the data read from the buffer; its MaxLength() specifies the amount of data to be read. |
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Read | ( | TInt | aPos, |
| TDes8 & | aDes, | ||
| TInt | aLength | ||
| ) | const |
Reads the specified number of bytes of data from the buffer into a descriptor.
| aPos | Buffer position from which data is read: must be in range zero to (Size() minus the length of the data to be read). |
| aDes | On return, contains data read from the buffer. |
| aLength | The length of the data to be read. |
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Reset | ( | ) |
Deletes all data in the buffer.
Its behaviour is the same as calling Delete(0,Size()). The buffer is compressed before the function returns.
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::ResizeL | ( | TInt | aSize | ) |
Re-sizes the buffer to the specified size.
The new size can be larger or smaller than the existing size.
If the new size is larger than the existing size, the buffer is expanded by adding uninitialised data to the end of it.
If the new size is smaller than the existing size, the buffer is reduced; any data at the end of the buffer is lost.
Notes:
| aSize | The new size of the buffer; this value must be greater than or equal to zero. |
(generated from Symbian Developer Library)
|
inline |
Gets the number of data bytes in the buffer.
Note that the number of heap bytes used by the buffer may be greater than its size, because there is typically extra room to allow for expansion. Use the Compress() function to reduce the extra allocation as much as possible.
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Write | ( | TInt | aPos, |
| const TAny * | aPtr, | ||
| TInt | aLength | ||
| ) |
Writes the specified number of bytes of data from the specified address to the buffer.
The data in the buffer is overwritten from the insertion point onwards.
No new space is allocated; this function cannot fail (provided the parameters are specified within the bounds of the buffer and descriptor).
No shuffling occurs: new data is written to the memory locations occupied by the data it overwrites.
| aPos | Buffer position at which data will begin to be written; must be in range zero to (Size() minus the length of the data to be written). |
| aPtr | The address of the data to be written. |
| aLength | The length of the data to be written. |
Panic condition: E32USER-CBase 7, if aLength is not positive
Panic condition: E32USER-CBase 5, if aPos + aLength is greater than the number of data bytes in the buffer, i.e. if the target appears to be outside the buffer.
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Write | ( | TInt | aPos, |
| const TDesC8 & | aDes | ||
| ) |
Writes data from a descriptor to the buffer.
The data in the descriptor overwrites the data in the buffer from the insertion point onwards.
No new space is allocated; this function cannot fail (provided the parameters are specified within the bounds of the buffer and descriptor).
No shuffling occurs; new data is written to the memory locations occupied by the data it overwrites.
| aPos | Buffer position at which data will begin to be written; must be in range zero to (Size() minus the length of the data to be written). |
| aDes | Contains the data to be written. The length of data to be written is the descriptor length. |
(generated from Symbian Developer Library)
| IMPORT_C void CBufBase::Write | ( | TInt | aPos, |
| const TDesC8 & | aDes, | ||
| TInt | aLength | ||
| ) |
Writes the specified number of bytes of data from a descriptor to the buffer.
The data in the descriptor overwrites the data in the buffer from the insertion point onwards.
No new space is allocated; this function cannot fail (provided the parameters are specified within the bounds of the buffer and descriptor).
No shuffling occurs; new data is written to the memory locations occupied by the data it overwrites.
| aPos | Buffer position at which data will begin to be written; must be in range zero to (Size() minus the length of the data to be written). |
| aDes | Contains the data to be written. |
| aLength | The length of the data to be written. |
(generated from Symbian Developer Library)