|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Provides a flat storage dynamic buffer. More...
#include <e32base.h>
Public Member Functions | |
| IMPORT_C | ~CBufFlat () |
| Destructor. | |
| TInt | Capacity () const |
| Gets the size to which the buffer may expand without re-allocation. | |
| IMPORT_C void | SetReserveL (TInt aSize) |
| Specifies a minimum amount of space which the flat buffer should occupy. | |
| IMPORT_C void | Compress () |
| Compresses the buffer so as to occupy minimal space. | |
| IMPORT_C void | Delete (TInt aPos, TInt aLength) |
| Deletes data from the buffer. | |
| IMPORT_C TPtr8 | Ptr (TInt aPos) |
| Gets a pointer descriptor to represent the data from the specified position to the end of the contiguous region containing that byte. | |
| IMPORT_C TPtr8 | BackPtr (TInt aPos) |
| 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 CBufBase | |
| 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. | |
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. | |
Static Public Member Functions | |
| static IMPORT_C CBufFlat * | NewL (TInt anExpandSize) |
| Allocates and constructs a flat buffer. | |
Static Public Member Functions inherited from CBase | |
| static IMPORT_C void | Delete (CBase *aPtr) |
| Deletes the specified object. | |
Protected Member Functions | |
| IMPORT_C | CBufFlat (TInt anExpandSize) |
| / : CBufBase(anExpandSize) { | |
Protected Member Functions inherited from CBufBase | |
| 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. | |
Additional Inherited Members | |
Protected Attributes inherited from CBufBase | |
| TInt | iSize |
| TInt | iExpandSize |
Provides a flat storage dynamic buffer.
This class should be used when high-speed pointer lookup is an important consideration, and you are reasonably confident that the insertion of data will not fail.
This class is an implementation of the abstract buffer interface provided by CBufBase and uses a single heap cell to contain the data.
| IMPORT_C CBufFlat::~CBufFlat | ( | ) |
Destructor.
Frees all resources owned by the object, prior to its destruction. Specifically, it frees the allocated cell used as a buffer.
(generated from Symbian Developer Library)
|
protected |
/ : CBufBase(anExpandSize) {
iMaxSize=0; iPtr=NULL; }
EXPORT_C CBufFlat::~CBufFlat() /** Destructor.
Frees all resources owned by the object, prior to its destruction. Specifically, it frees the allocated cell used as a buffer.
(generated from Original Symbian implementation)
|
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(). |
Implements CBufBase.
|
inline |
Gets the size to which the buffer may expand without re-allocation.
(generated from Symbian Developer Library)
|
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.
Implements CBufBase.
|
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. |
Implements CBufBase.
|
static |
Allocates and constructs a flat buffer.
If there is insufficient memory available to allocate the flat buffer, the function leaves.
| anExpandSize | The granularity of buffer expansion. Additional space, when required, is always allocated in multiples of this number. Note: although a value of zero is permitted by this interface, it has no meaning, and risks raising panics later during execution. We suggest that you pass a positive value. |
Panic condition: E32USER-CBase 3 if the granularity is negative.
(generated from Symbian Developer Library)
|
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(). |
Implements CBufBase.
| IMPORT_C void CBufFlat::SetReserveL | ( | TInt | aSize | ) |
Specifies a minimum amount of space which the flat buffer should occupy.
If the required size is zero, the heap cell is deleted. If it is different from the current size, the heap cell is rellocated accordingly.
| aSize | The size of the buffer required. If there is no data in the buffer, i.e. Size() returns zero, then this value can be zero, which causes the buffer's allocated heap cell to be deleted. |
Panic condition: E32USER-CBase 10, if aSize is negative.
Panic condition: E32USER-CBase 11, if there is data in the buffer, and aSize is less than the value returned by Size().
(generated from Symbian Developer Library)