Base Module VST 3.7
SDK for developing VST plug-in
FStreamer Class Referenceabstract

Byteorder-aware base class for typed stream i/o. More...

#include <fstreamer.h>

+ Inheritance diagram for FStreamer:

Public Member Functions

 FStreamer (int16 byteOrder=BYTEORDER)
 
virtual ~FStreamer ()
 
bool skip (uint32 bytes)
 
bool pad (uint32 bytes)
 
Implementing class must override.
virtual TSize readRaw (void *, TSize)=0
 Read one buffer of size. More...
 
virtual TSize writeRaw (const void *, TSize)=0
 Write one buffer of size. More...
 
virtual int64 seek (int64, FSeekMode)=0
 Set file position for stream. More...
 
virtual int64 tell ()=0
 Return current file position. More...
 
Streams are byteOrder aware.
void setByteOrder (int32 e)
 
int32 getByteOrder () const
 
read and write int8 and char.
bool writeChar8 (char8)
 
bool readChar8 (char8 &)
 
bool writeUChar8 (unsigned char)
 
bool readUChar8 (unsigned char &)
 
bool writeChar16 (char16 c)
 
bool readChar16 (char16 &c)
 
bool writeInt8 (int8 c)
 
bool readInt8 (int8 &c)
 
bool writeInt8u (uint8 c)
 
bool readInt8u (uint8 &c)
 
read and write int16.
bool writeInt16 (int16)
 
bool readInt16 (int16 &)
 
bool writeInt16Array (const int16 *array, int32 count)
 
bool readInt16Array (int16 *array, int32 count)
 
bool writeInt16u (uint16)
 
bool readInt16u (uint16 &)
 
bool writeInt16uArray (const uint16 *array, int32 count)
 
bool readInt16uArray (uint16 *array, int32 count)
 
read and write int32.
bool writeInt32 (int32)
 
bool readInt32 (int32 &)
 
bool writeInt32Array (const int32 *array, int32 count)
 
bool readInt32Array (int32 *array, int32 count)
 
bool writeInt32u (uint32)
 
bool readInt32u (uint32 &)
 
bool writeInt32uArray (const uint32 *array, int32 count)
 
bool readInt32uArray (uint32 *array, int32 count)
 
read and write int64.
bool writeInt64 (int64)
 
bool readInt64 (int64 &)
 
bool writeInt64Array (const int64 *array, int32 count)
 
bool readInt64Array (int64 *array, int32 count)
 
bool writeInt64u (uint64)
 
bool readInt64u (uint64 &)
 
bool writeInt64uArray (const uint64 *array, int32 count)
 
bool readInt64uArray (uint64 *array, int32 count)
 
read and write float and float array.
bool writeFloat (float)
 
bool readFloat (float &)
 
bool writeFloatArray (const float *array, int32 count)
 
bool readFloatArray (float *array, int32 count)
 
read and write double and double array.
bool writeDouble (double)
 
bool readDouble (double &)
 
bool writeDoubleArray (const double *array, int32 count)
 
bool readDoubleArray (double *array, int32 count)
 
read and write Boolean.
bool writeBool (bool)
 Write one boolean. More...
 
bool readBool (bool &)
 Read one bool. More...
 

Protected Attributes

int16 byteOrder
 

read and write Strings.

TSize writeString8 (const char8 *ptr, bool terminate=false)
 a direct output function writing only one string (ascii 8bit) More...
 
TSize readString8 (char8 *ptr, TSize size)
 a direct input function reading only one string (ascii) (ended by a
or \0 or eof) More...
 
bool writeStr8 (const char8 *ptr)
 write a string length (strlen) and string itself More...
 
char8 * readStr8 ()
 read a string length and string text (The return string must be deleted when use is finished) More...
 
bool writeStringUtf8 (const char *ptr)
 always terminated, converts to utf8 if non ascii characters are in string More...
 
int32 readStringUtf8 (char *ptr, int32 maxSize)
 read a UTF8 string More...
 
static int32 getStr8Size (const char8 *ptr)
 returns the size of a saved string More...
 

Detailed Description

Byteorder-aware base class for typed stream i/o.

Constructor & Destructor Documentation

◆ FStreamer()

FStreamer ( int16  byteOrder = BYTEORDER)

◆ ~FStreamer()

virtual ~FStreamer ( )
inlinevirtual

Member Function Documentation

◆ readRaw()

virtual TSize readRaw ( void *  ,
TSize   
)
pure virtual

Read one buffer of size.

Implemented in IBStreamer.

◆ writeRaw()

virtual TSize writeRaw ( const void *  ,
TSize   
)
pure virtual

Write one buffer of size.

Implemented in IBStreamer.

◆ seek()

virtual int64 seek ( int64  ,
FSeekMode   
)
pure virtual

Set file position for stream.

Implemented in IBStreamer.

◆ tell()

virtual int64 tell ( )
pure virtual

Return current file position.

Implemented in IBStreamer.

◆ setByteOrder()

void setByteOrder ( int32  e)
inline

◆ getByteOrder()

int32 getByteOrder ( ) const
inline

◆ writeChar8()

bool writeChar8 ( char8  c)

◆ readChar8()

bool readChar8 ( char8 &  c)

◆ writeUChar8()

bool writeUChar8 ( unsigned char  c)

◆ readUChar8()

bool readUChar8 ( unsigned char &  c)

◆ writeChar16()

bool writeChar16 ( char16  c)

◆ readChar16()

bool readChar16 ( char16 &  c)

◆ writeInt8()

bool writeInt8 ( int8  c)

◆ readInt8()

bool readInt8 ( int8 &  c)

◆ writeInt8u()

bool writeInt8u ( uint8  c)

◆ readInt8u()

bool readInt8u ( uint8 &  c)

◆ writeInt16()

bool writeInt16 ( int16  i)

◆ readInt16()

bool readInt16 ( int16 &  i)

◆ writeInt16Array()

bool writeInt16Array ( const int16 *  array,
int32  count 
)

◆ readInt16Array()

bool readInt16Array ( int16 *  array,
int32  count 
)

◆ writeInt16u()

bool writeInt16u ( uint16  i)

◆ readInt16u()

bool readInt16u ( uint16 &  i)

◆ writeInt16uArray()

bool writeInt16uArray ( const uint16 *  array,
int32  count 
)

◆ readInt16uArray()

bool readInt16uArray ( uint16 *  array,
int32  count 
)

◆ writeInt32()

bool writeInt32 ( int32  i)

◆ readInt32()

bool readInt32 ( int32 &  i)

◆ writeInt32Array()

bool writeInt32Array ( const int32 *  array,
int32  count 
)

◆ readInt32Array()

bool readInt32Array ( int32 *  array,
int32  count 
)

◆ writeInt32u()

bool writeInt32u ( uint32  i)

◆ readInt32u()

bool readInt32u ( uint32 &  i)

◆ writeInt32uArray()

bool writeInt32uArray ( const uint32 *  array,
int32  count 
)

◆ readInt32uArray()

bool readInt32uArray ( uint32 *  array,
int32  count 
)

◆ writeInt64()

bool writeInt64 ( int64  i)

◆ readInt64()

bool readInt64 ( int64 &  i)

◆ writeInt64Array()

bool writeInt64Array ( const int64 *  array,
int32  count 
)

◆ readInt64Array()

bool readInt64Array ( int64 *  array,
int32  count 
)

◆ writeInt64u()

bool writeInt64u ( uint64  i)

◆ readInt64u()

bool readInt64u ( uint64 &  i)

◆ writeInt64uArray()

bool writeInt64uArray ( const uint64 *  array,
int32  count 
)

◆ readInt64uArray()

bool readInt64uArray ( uint64 *  array,
int32  count 
)

◆ writeFloat()

bool writeFloat ( float  f)

◆ readFloat()

bool readFloat ( float &  f)

◆ writeFloatArray()

bool writeFloatArray ( const float *  array,
int32  count 
)

◆ readFloatArray()

bool readFloatArray ( float *  array,
int32  count 
)

◆ writeDouble()

bool writeDouble ( double  d)

◆ readDouble()

bool readDouble ( double &  d)

◆ writeDoubleArray()

bool writeDoubleArray ( const double *  array,
int32  count 
)

◆ readDoubleArray()

bool readDoubleArray ( double *  array,
int32  count 
)

◆ writeBool()

bool writeBool ( bool  b)

Write one boolean.

◆ readBool()

bool readBool ( bool &  b)

Read one bool.

◆ writeString8()

TSize writeString8 ( const char8 *  ptr,
bool  terminate = false 
)

a direct output function writing only one string (ascii 8bit)

◆ readString8()

TSize readString8 ( char8 *  ptr,
TSize  size 
)

a direct input function reading only one string (ascii) (ended by a
or \0 or eof)

◆ writeStr8()

bool writeStr8 ( const char8 *  ptr)

write a string length (strlen) and string itself

◆ readStr8()

char8 * readStr8 ( )

read a string length and string text (The return string must be deleted when use is finished)

◆ getStr8Size()

int32 getStr8Size ( const char8 *  ptr)
static

returns the size of a saved string

◆ writeStringUtf8()

bool writeStringUtf8 ( const char *  ptr)

always terminated, converts to utf8 if non ascii characters are in string

◆ readStringUtf8()

int32 readStringUtf8 ( char *  ptr,
int32  maxSize 
)

read a UTF8 string

◆ skip()

bool skip ( uint32  bytes)

◆ pad()

bool pad ( uint32  bytes)

Member Data Documentation

◆ byteOrder

int16 byteOrder
protected
Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.