67 virtual TSize
writeRaw (
const void*, TSize) = 0;
68 virtual int64
seek (int64, FSeekMode) = 0;
74 inline void setByteOrder (int32 e) { byteOrder = (int16)e; }
75 inline int32 getByteOrder ()
const {
return byteOrder; }
80 bool writeChar8 (char8);
81 bool readChar8 (char8&);
82 bool writeUChar8 (
unsigned char);
83 bool readUChar8 (
unsigned char&);
84 bool writeChar16 (char16 c);
85 bool readChar16 (char16& c);
87 bool writeInt8 (int8 c);
88 bool readInt8 (int8& c);
89 bool writeInt8u (uint8 c);
90 bool readInt8u (uint8& c);
95 bool writeInt16 (int16);
96 bool readInt16 (int16&);
97 bool writeInt16Array (
const int16* array, int32 count);
98 bool readInt16Array (int16* array, int32 count);
99 bool writeInt16u (uint16);
100 bool readInt16u (uint16&);
101 bool writeInt16uArray (
const uint16* array, int32 count);
102 bool readInt16uArray (uint16* array, int32 count);
107 bool writeInt32 (int32);
108 bool readInt32 (int32&);
109 bool writeInt32Array (
const int32* array, int32 count);
110 bool readInt32Array (int32* array, int32 count);
111 bool writeInt32u (uint32);
112 bool readInt32u (uint32&);
113 bool writeInt32uArray (
const uint32* array, int32 count);
114 bool readInt32uArray (uint32* array, int32 count);
119 bool writeInt64 (int64);
120 bool readInt64 (int64&);
121 bool writeInt64Array (
const int64* array, int32 count);
122 bool readInt64Array (int64* array, int32 count);
123 bool writeInt64u (uint64);
124 bool readInt64u (uint64&);
125 bool writeInt64uArray (
const uint64* array, int32 count);
126 bool readInt64uArray (uint64* array, int32 count);
131 bool writeFloat (
float);
132 bool readFloat (
float&);
133 bool writeFloatArray (
const float* array, int32 count);
134 bool readFloatArray (
float* array, int32 count);
139 bool writeDouble (
double);
140 bool readDouble (
double&);
141 bool writeDoubleArray (
const double* array, int32 count);
142 bool readDoubleArray (
double* array, int32 count);
153 TSize
writeString8 (
const char8* ptr,
bool terminate =
false);
165 bool skip (uint32 bytes);
166 bool pad (uint32 bytes);
232 TSize
readRaw (
void*, TSize) SMTG_OVERRIDE;
233 TSize
writeRaw (
const void*, TSize) SMTG_OVERRIDE;
234 int64
seek (int64, FSeekMode) SMTG_OVERRIDE;
235 int64
tell () SMTG_OVERRIDE;
FStreamSizeHolder Declaration remembers size of stream chunk for backward compatibility.
void beginWrite()
remembers position and writes 0
void endRead()
jump to end of chunk
int32 endWrite()
writes and returns size (since the start marker)
int32 beginRead()
returns size
Byteorder-aware base class for typed stream i/o.
char8 * readStr8()
read a string length and string text (The return string must be deleted when use is finished)
virtual TSize writeRaw(const void *, TSize)=0
Write one buffer of size.
TSize writeString8(const char8 *ptr, bool terminate=false)
a direct output function writing only one string (ascii 8bit)
int32 readStringUtf8(tchar *ptr, int32 maxSize)
read a UTF8 string
virtual int64 seek(int64, FSeekMode)=0
Set file position for stream.
TSize readString8(char8 *ptr, TSize size)
a direct input function reading only one string (ascii) (ended by a or \0 or eof)
virtual int64 tell()=0
Return current file position.
static int32 getStr8Size(const char8 *ptr)
returns the size of a saved string
bool writeStringUtf8(const tchar *ptr)
always terminated, converts to utf8 if non ascii characters are in string
bool writeBool(bool)
Write one boolean.
virtual TSize readRaw(void *, TSize)=0
Read one buffer of size.
bool writeStr8(const char8 *ptr)
write a string length (strlen) and string itself
bool readBool(bool &)
Read one bool.
Wrapper class for typed reading/writing from or to IBStream.
IBStream * getStream()
Returns the associated IBStream.
int64 tell() SMTG_OVERRIDE
Return current file position.
TSize writeRaw(const void *, TSize) SMTG_OVERRIDE
Write one buffer of size.
TSize readRaw(void *, TSize) SMTG_OVERRIDE
Read one buffer of size.
int64 seek(int64, FSeekMode) SMTG_OVERRIDE
Set file position for stream.