class TBufBuf : public TStreamBuf |
A stream buffer that uses a dynamic buffer for its implementation.
A stream of this type is used by RBufWriteStream and RBufReadStream objects. It also has intermediate buffering capabilities.
This is a seekable stream buffer.
There are three write modes:
insert mode - inserts new data into the buffer at the offset passed to Set()
overwrite mode - replaces the data in the buffer starting at the offset passed to Set(). Once the end of the buffer is reached, it is automatically extended as more data is written. This is the default mode.
truncate mode - truncates the buffer to the offset passed to Set() before data is written, extending the buffer. When writing, the buffer size as reported by CBufBase::Size() may be larger than the data written to the stream. To synchronise the buffer's reported size with the stream, call the MStreamBuf::SynchL() function.
Note that this object never takes ownership of the dynamic buffer, the CBufBase type object.
Public Member Functions | |
---|---|
TBufBuf() | |
IMPORT_C void | Set(CBufBase &, TInt, TInt) |
Protected Member Functions | |
---|---|
IMPORT_C TStreamPos | DoSeekL(TMark, TStreamLocation, TInt) |
IMPORT_C void | DoSynchL() |
IMPORT_C void | DoWriteL(const TAny *, TInt) |
IMPORT_C void | OverflowL() |
IMPORT_C TInt | UnderflowL(TInt) |
Private Member Functions | |
---|---|
CBufBase & | Buf() |
void | Consolidate() |
TInt | Mark(TRead) |
TInt | Mark(TWrite) |
TInt | MovePos(TRead, TInt) |
TInt | MovePos(TWrite, TInt) |
TInt | Pos(TMark) |
TInt | Pos(TRead) |
TInt | Pos(TWrite) |
void | SetPos(TMark, TInt) |
void | SetPos(TRead, TInt) |
void | SetPos(TWrite, TInt) |
Inherited Enumerations | |
---|---|
MStreamBuf:TRead | |
MStreamBuf:TWrite |
Private Attributes | |
---|---|
CBufBase * | iBuf |
TInt | iMode |
TInt | iRPos |
TInt | iWPos |
IMPORT_C TStreamPos | DoSeekL | ( | TMark | aMark, |
TStreamLocation | aLocation, | |||
TInt | anOffset | |||
) | [protected, virtual] |
TMark aMark | |
TStreamLocation aLocation | |
TInt anOffset |
IMPORT_C void | DoWriteL | ( | const TAny * | aPtr, |
TInt | aLength | |||
) | [protected, virtual] |
IMPORT_C void | OverflowL | ( | ) | [protected, virtual] |
Empties the intermediate buffer and resets the start and end points of the write area.
The implementation of this function depends on the way the stream itself is implemented. For example, the in-memory streams have simple implementations.
IMPORT_C TInt | UnderflowL | ( | TInt | aMaxLength | ) | [protected, virtual] |
Re-fills the intermediate buffer and resets the start and end points of the read area.
The implementation of this function depends on the way the stream itself is implemented. For example, the in-memory streams have simple implementations.
The amount of data available in the intermediate buffer.
TInt aMaxLength | The maximum amount of data required for the intermediate buffer. |