#include <ZStream.h>
Inheritance diagram for ZStreamWPos:
Public Member Functions | |
Position and size API | |
uint64 | GetPosition () const |
void | SetPosition (uint64 iPosition) const |
uint64 | GetSize () const |
void | SetSize (uint64 iSize) const |
void | Truncate () const |
Essential overrides | |
API that must be overridden. | |
virtual uint64 | Imp_GetPosition ()=0 |
virtual void | Imp_SetPosition (uint64 iPosition)=0 |
virtual uint64 | Imp_GetSize ()=0 |
virtual void | Imp_SetSize (uint64 iSize)=0 |
Optionally overridable API | |
virtual void | Imp_Truncate () |
Set the stream's size to match its current position. |
A ZStreamWPos augments ZStreamW with two attributes, a size and a position.
uint64 ZStreamWPos::GetPosition | ( | ) | const [inline] |
Return the stream's position.
Reimplemented in ZStreamRWPos.
void ZStreamWPos::SetPosition | ( | uint64 | iPosition | ) | const [inline] |
Set the stream's position, without making any change in its size, even if iPosition is greater than the stream's size.
Reimplemented in ZStreamRWPos.
uint64 ZStreamWPos::GetSize | ( | ) | const [inline] |
Return the stream's size.
Reimplemented in ZStreamRWPos.
void ZStreamWPos::SetSize | ( | uint64 | iSize | ) | const [inline] |
Set the stream's size, without making any change in its position even if that position is greater than iSize.
void ZStreamWPos::Truncate | ( | ) | const [inline] |
Set the stream's size to be the stream's position.
void ZStreamWPos::Imp_Truncate | ( | ) | [virtual] |
Set the stream's size to match its current position.
The default implementation uses the stream's own SetSize
and GetPosition
methods. Subclasses may be able to implement this more efficiently.