|
||
class CBufFlat : public CBufBase;
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.
CBase
-
Base class for all classes to be instantiated on the heap.
CBufBase
-
Defines the interface for dynamic buffers.
CBufFlat
-
Provides a flat storage dynamic buffer.
Defined in CBufFlat
:
BackPtr(TInt)
Gets a pointer descriptor to represent the data starting at the beginning of the...Capacity()const
Gets the size to which the buffer may expand without re-allocation.Compress()
Compresses the buffer so as to occupy minimal space.Delete(TInt,TInt)
Deletes data from the buffer.DoInsertL(TInt,const TAny *,TInt)
NewL(TInt)
Allocates and constructs a flat buffer.Ptr(TInt)
Gets a pointer descriptor to represent the data starting at the specified data b...SetReserveL(TInt)
Specifies a minimum amount of space which the flat buffer should occupy.~CBufFlat()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CBufBase
:
ExpandL(TInt,TInt)
Inserts an uninitialised region into the buffer.InsertL(TInt,const TAny *,TInt)
Inserts bytes of data from the specified address into the buffer.InsertL(TInt,const TDesC8 &)
Inserts data into the buffer.InsertL(TInt,const TDesC8 &,TInt)
Inserts the specified number of bytes of data from a descriptor into the buffer.Read(TInt,TAny *,TInt)const
Reads the specified number of bytes of data from the buffer into a specified add...Read(TInt,TDes8 &)const
Reads data from the buffer into a descriptor.Read(TInt,TDes8 &,TInt)const
Reads the specified number of bytes of data from the buffer into a descriptor.Reset()
Deletes all data in the buffer.ResizeL(TInt)
Re-sizes the buffer to the specified size.Size()const
Gets the number of data bytes in the buffer.Write(TInt,const TAny *,TInt)
Writes the specified number of bytes of data from the specified address to the b...Write(TInt,const TDesC8 &)
Writes data from a descriptor to the buffer.Write(TInt,const TDesC8 &,TInt)
Writes the specified number of bytes of data from a descriptor to the buffer.iExpandSize
iSize
IMPORT_C ~CBufFlat();
Destructor.
Frees all resources owned by the object, prior to its destruction. Specifically, it frees the allocated cell used as a buffer.
IMPORT_C static CBufFlat* NewL(TInt anExpandSize);
Allocates and constructs a flat buffer.
If there is insufficient memory available to allocate the flat buffer, the function leaves.
|
|
|
inline 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.
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.
|
|
IMPORT_C virtual void Compress();
Compresses the buffer so as to occupy minimal space.
This frees any unused memory at the end of the buffer.
CBufBase::Compress()
Compresses the buffer so as to occupy minimal space.IMPORT_C virtual void Delete(TInt aPos, TInt aLength);
Deletes data from the buffer.
During deletion, any data beyond the deleted data is shuffled up so that the buffer contents are contiguous. No memory is freed.
|
|
CBufBase::Delete(TInt,TInt)
Deletes data from the buffer.IMPORT_C virtual TPtr8 Ptr(TInt aPos);
Gets a pointer descriptor to represent the data starting at the specified data byte through to the end of the contiguous region containing that byte.
Calculation of the pointer and length involves only a few machine instructions and is independent of the data contained in the buffer.
|
|
IMPORT_C virtual TPtr8 BackPtr(TInt aPos);
Gets a pointer descriptor to represent the data starting at the beginning of the contiguous region containing that byte through to the byte immediately preceding the specified byte.
The descriptor always points to the beginning of the buffer containing the specified byte. Calculation of the pointer and length involves only a few machine instructions and is independent of the data contained in the buffer.
|
|
CBufBase::BackPtr(TInt)
Gets a pointer descriptor to represent data from just before the specified data ...