@ -61,8 +61,8 @@ struct FileEntry;
# define LogReadSafeString() ReadSafeString();
# define LogReadSafeStringLong() ReadSafeStringLong();
# define LogSkip(deltaByteCount, desc) Skip(deltaByteCount)
# define LogReadSwap(value, desc) ReadSwap (value)
# define LogReadSwapArray(count, values, desc) ReadSwap (count, values)
# define LogReadLE(value, desc) ReadLE (value)
# define LogReadLEArray(count, values, desc) ReadLE (count, values)
# define LogSubStreamStart(desc) LogVoidFunc()
# define LogSubStreamPushDesc(desc) LogVoidFunc()
# define LogSubStreamEnd() LogVoidFunc()
@ -110,10 +110,10 @@ public:
virtual void LogSkip ( UInt32 deltaByteCount , const char * desc ) { Skip ( deltaByteCount ) ; }
// Stream Notes for Logging
virtual void LogStringString ( const char * s ) { }
virtual void LogSubStreamStart ( const char * desc ) { }
virtual void LogSubStreamEnd ( ) { }
virtual void LogSubStreamPushDesc ( const char * desc ) { }
virtual void LogStringString ( const char * s ) { }
virtual void LogSubStreamStart ( const char * desc ) { }
virtual void LogSubStreamEnd ( ) { }
virtual void LogSubStreamPushDesc ( const char * desc ) { }
# endif
void LogVoidFunc ( ) { }
@ -132,178 +132,178 @@ public:
UInt32 WriteFmt ( const char * fmt , . . . ) ;
UInt32 WriteFmtV ( const char * fmt , va_list av ) ;
UInt32 WriteSafeStringLong ( const char * string ) ; // uses 4 bytes for length
UInt32 WriteSafeWStringLong ( const wchar_t * string ) ;
char * ReadSafeStringLong ( ) ;
wchar_t * ReadSafeWStringLong ( ) ;
UInt32 WriteSafeStringLong ( const char * string ) ; // uses 4 bytes for length
UInt32 WriteSafeWStringLong ( const wchar_t * string ) ;
char * ReadSafeStringLong ( ) ;
wchar_t * ReadSafeWStringLong ( ) ;
UInt32 WriteSafeString ( const char * string ) ; // uses 2 bytes for length
UInt32 WriteSafeWString ( const wchar_t * string ) ;
char * ReadSafeString ( ) ;
wchar_t * ReadSafeWString ( ) ;
UInt32 WriteSafeString ( const char * string ) ; // uses 2 bytes for length
UInt32 WriteSafeWString ( const wchar_t * string ) ;
char * ReadSafeString ( ) ;
wchar_t * ReadSafeWString ( ) ;
hsBool GetToken ( char * s , UInt32 maxLen = UInt32 ( - 1 ) , const char beginComment = kComment , const char endComment = kEolnCode ) ;
hsBool ReadLn ( char * s , UInt32 maxLen = UInt32 ( - 1 ) , const char beginComment = kComment , const char endComment = kEolnCode ) ;
hsBool GetToken ( char * s , UInt32 maxLen = UInt32 ( - 1 ) , const char beginComment = kComment , const char endComment = kEolnCode ) ;
hsBool ReadLn ( char * s , UInt32 maxLen = UInt32 ( - 1 ) , const char beginComment = kComment , const char endComment = kEolnCode ) ;
bool Readbool ( ) ;
hsBool ReadBool ( ) ;
void ReadBool ( int count , hsBool values [ ] ) ;
UInt16 ReadSwap 16( ) ;
void ReadSwap 16( int count , UInt16 values [ ] ) ;
UInt32 ReadSwap 32( ) ;
void ReadSwap 32( int count , UInt32 values [ ] ) ;
UInt32 ReadUnswap 32( ) ;
bool Readbool ( ) ;
hsBool ReadBool ( ) ;
void ReadBool ( int count , hsBool values [ ] ) ;
UInt16 ReadLE 16 ( ) ;
void ReadLE 16 ( int count , UInt16 values [ ] ) ;
UInt32 ReadLE 32 ( ) ;
void ReadLE 32 ( int count , UInt32 values [ ] ) ;
UInt32 ReadBE 32 ( ) ;
void Writebool ( bool value ) ;
void WriteBool ( hsBool value ) ;
void WriteBool ( int count , const hsBool values [ ] ) ;
void WriteByte ( UInt8 value ) ;
void WriteSwap 16 ( UInt16 value ) ;
void WriteSwap 16 ( int count , const UInt16 values [ ] ) ;
void WriteSwap 32 ( UInt32 value ) ;
void WriteSwap 32 ( int count , const UInt32 values [ ] ) ;
void WriteUnswap 32 ( UInt32 value ) ;
void WriteLE 16 ( UInt16 value ) ;
void WriteLE 16 ( int count , const UInt16 values [ ] ) ;
void WriteLE 32 ( UInt32 value ) ;
void WriteLE 32 ( int count , const UInt32 values [ ] ) ;
void WriteBE 32 ( UInt32 value ) ;
/* Overloaded Begin (8 & 16 & 32 int)*/
/* yes, swapping an 8 bit value does nothing, just useful*/
void ReadSwap ( bool * value ) { * value = this - > ReadByte ( ) ? true : false ; }
void ReadSwap ( UInt8 * value ) { * value = this - > ReadByte ( ) ; }
void ReadSwap ( int count , UInt8 values [ ] ) { this - > Read ( count , values ) ; }
void ReadSwap ( UInt16 * value ) { * value = this - > ReadSwap 16 ( ) ; }
void ReadSwap ( int count , UInt16 values [ ] ) { this - > ReadSwap 16 ( count , values ) ; }
void ReadSwap ( UInt32 * value ) { * value = this - > ReadSwap 32 ( ) ; }
void ReadSwap ( int count , UInt32 values [ ] ) { this - > ReadSwap 32 ( count , values ) ; }
void ReadLE ( bool * value ) { * value = this - > ReadByte ( ) ? true : false ; }
void ReadLE ( UInt8 * value ) { * value = this - > ReadByte ( ) ; }
void ReadLE ( int count , UInt8 values [ ] ) { this - > Read ( count , values ) ; }
void ReadLE ( UInt16 * value ) { * value = this - > ReadLE 16 ( ) ; }
void ReadLE ( int count , UInt16 values [ ] ) { this - > ReadLE 16 ( count , values ) ; }
void ReadLE ( UInt32 * value ) { * value = this - > ReadLE 32 ( ) ; }
void ReadLE ( int count , UInt32 values [ ] ) { this - > ReadLE 32 ( count , values ) ; }
# ifdef STREAM_LOGGER
// Begin LogReadSwap s
virtual void LogReadSwap ( bool * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap ( UInt8 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , UInt8 values [ ] , const char * desc ) { this - > ReadSwap ( count , values ) ; }
virtual void LogReadSwap ( UInt16 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , UInt16 values [ ] , const char * desc ) { this - > ReadSwap ( count , values ) ; }
virtual void LogReadSwap ( UInt32 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , UInt32 values [ ] , const char * desc ) { this - > ReadSwap ( count , values ) ; }
// End LogReadSwap s
// Begin LogReadLE s
virtual void LogReadLE ( bool * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE ( UInt8 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , UInt8 values [ ] , const char * desc ) { this - > ReadLE ( count , values ) ; }
virtual void LogReadLE ( UInt16 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , UInt16 values [ ] , const char * desc ) { this - > ReadLE ( count , values ) ; }
virtual void LogReadLE ( UInt32 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , UInt32 values [ ] , const char * desc ) { this - > ReadLE ( count , values ) ; }
// End LogReadLE s
# endif
void WriteSwap ( bool value ) { this - > Write ( 1 , & value ) ; }
void WriteSwap ( UInt8 value ) { this - > Write ( 1 , & value ) ; }
void WriteSwap ( int count , const UInt8 values [ ] ) { this - > Write ( count , values ) ; }
void WriteSwap ( UInt16 value ) { this - > WriteSwap 16 ( value ) ; }
void WriteSwap ( int count , const UInt16 values [ ] ) { this - > WriteSwap 16 ( count , values ) ; }
void WriteSwap ( UInt32 value ) { this - > WriteSwap 32 ( value ) ; }
void WriteSwap ( int count , const UInt32 values [ ] ) { this - > WriteSwap 32 ( count , values ) ; }
void ReadSwap ( Int8 * value ) { * value = this - > ReadByte ( ) ; }
void ReadSwap ( int count , Int8 values [ ] ) { this - > Read ( count , values ) ; }
void ReadSwap ( char * value ) { * value = ( char ) this - > ReadByte ( ) ; }
void ReadSwap ( int count , char values [ ] ) { this - > Read ( count , values ) ; }
void ReadSwap ( Int16 * value ) { * value = ( Int16 ) this - > ReadSwap 16 ( ) ; }
void ReadSwap ( int count , Int16 values [ ] ) { this - > ReadSwap 16 ( count , ( UInt16 * ) values ) ; }
void ReadSwap ( Int32 * value ) { * value = ( Int32 ) this - > ReadSwap 32 ( ) ; }
void ReadSwap ( int count , Int32 values [ ] ) { this - > ReadSwap 32 ( count , ( UInt32 * ) values ) ; }
void WriteLE ( bool value ) { this - > Write ( 1 , & value ) ; }
void WriteLE ( UInt8 value ) { this - > Write ( 1 , & value ) ; }
void WriteLE ( int count , const UInt8 values [ ] ) { this - > Write ( count , values ) ; }
void WriteLE ( UInt16 value ) { this - > WriteLE 16 ( value ) ; }
void WriteLE ( int count , const UInt16 values [ ] ) { this - > WriteLE 16 ( count , values ) ; }
void WriteLE ( UInt32 value ) { this - > WriteLE 32 ( value ) ; }
void WriteLE ( int count , const UInt32 values [ ] ) { this - > WriteLE 32 ( count , values ) ; }
void ReadLE ( Int8 * value ) { * value = this - > ReadByte ( ) ; }
void ReadLE ( int count , Int8 values [ ] ) { this - > Read ( count , values ) ; }
void ReadLE ( char * value ) { * value = ( char ) this - > ReadByte ( ) ; }
void ReadLE ( int count , char values [ ] ) { this - > Read ( count , values ) ; }
void ReadLE ( Int16 * value ) { * value = ( Int16 ) this - > ReadLE 16 ( ) ; }
void ReadLE ( int count , Int16 values [ ] ) { this - > ReadLE 16 ( count , ( UInt16 * ) values ) ; }
void ReadLE ( Int32 * value ) { * value = ( Int32 ) this - > ReadLE 32 ( ) ; }
void ReadLE ( int count , Int32 values [ ] ) { this - > ReadLE 32 ( count , ( UInt32 * ) values ) ; }
# ifdef STREAM_LOGGER
// Begin LogReadSwap s
virtual void LogReadSwap ( Int8 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , Int8 values [ ] , const char * desc ) { this - > ReadSwap ( count , values ) ; }
virtual void LogReadSwap ( char * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , char values [ ] , const char * desc ) { this - > ReadSwap ( count , values ) ; }
virtual void LogReadSwap ( Int16 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , Int16 values [ ] , const char * desc ) { this - > ReadSwap ( count , ( UInt16 * ) values ) ; }
virtual void LogReadSwap ( Int32 * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , Int32 values [ ] , const char * desc ) { this - > ReadSwap ( count , ( UInt32 * ) values ) ; }
virtual void LogReadSwap ( int * value , const char * desc ) { this - > ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , int values [ ] , const char * desc ) { this - > ReadSwap ( count , ( UInt32 * ) values ) ; }
// End LogReadSwap s
// Begin LogReadLE s
virtual void LogReadLE ( Int8 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , Int8 values [ ] , const char * desc ) { this - > ReadLE ( count , values ) ; }
virtual void LogReadLE ( char * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , char values [ ] , const char * desc ) { this - > ReadLE ( count , values ) ; }
virtual void LogReadLE ( Int16 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , Int16 values [ ] , const char * desc ) { this - > ReadLE ( count , ( UInt16 * ) values ) ; }
virtual void LogReadLE ( Int32 * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , Int32 values [ ] , const char * desc ) { this - > ReadLE ( count , ( UInt32 * ) values ) ; }
virtual void LogReadLE ( int * value , const char * desc ) { this - > ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , int values [ ] , const char * desc ) { this - > ReadLE ( count , ( UInt32 * ) values ) ; }
// End LogReadLE s
# endif
void WriteSwap ( Int8 value ) { this - > Write ( 1 , & value ) ; }
void WriteSwap ( int count , const Int8 values [ ] ) { this - > Write ( count , values ) ; }
void WriteSwap ( char value ) { this - > Write ( 1 , ( UInt8 * ) & value ) ; }
void WriteSwap ( int count , const char values [ ] ) { this - > Write ( count , ( UInt8 * ) values ) ; }
void WriteSwap ( Int16 value ) { this - > WriteSwap 16 ( ( UInt16 ) value ) ; }
void WriteSwap ( int count , const Int16 values [ ] ) { this - > WriteSwap 16 ( count , ( UInt16 * ) values ) ; }
void WriteSwap ( Int32 value ) { this - > WriteSwap 32 ( ( UInt32 ) value ) ; }
void WriteSwap ( int count , const Int32 values [ ] ) { this - > WriteSwap 32 ( count , ( UInt32 * ) values ) ; }
void WriteLE ( Int8 value ) { this - > Write ( 1 , & value ) ; }
void WriteLE ( int count , const Int8 values [ ] ) { this - > Write ( count , values ) ; }
void WriteLE ( char value ) { this - > Write ( 1 , ( UInt8 * ) & value ) ; }
void WriteLE ( int count , const char values [ ] ) { this - > Write ( count , ( UInt8 * ) values ) ; }
void WriteLE ( Int16 value ) { this - > WriteLE 16 ( ( UInt16 ) value ) ; }
void WriteLE ( int count , const Int16 values [ ] ) { this - > WriteLE 16 ( count , ( UInt16 * ) values ) ; }
void WriteLE ( Int32 value ) { this - > WriteLE 32 ( ( UInt32 ) value ) ; }
void WriteLE ( int count , const Int32 values [ ] ) { this - > WriteLE 32 ( count , ( UInt32 * ) values ) ; }
/* Overloaded End */
# if HS_CAN_USE_FLOAT
float ReadSwap Float ( ) ;
void ReadSwap Float ( int count , float values [ ] ) ;
double ReadSwap Double ( ) ;
void ReadSwap Double ( int count , double values [ ] ) ;
float ReadUnswap Float ( ) ;
void WriteSwap Float ( float value ) ;
void WriteSwap Float ( int count , const float values [ ] ) ;
void WriteSwap Double ( double value ) ;
void WriteSwap Double ( int count , const double values [ ] ) ;
void WriteUnswap Float ( float value ) ;
float ReadLE Float ( ) ;
void ReadLE Float ( int count , float values [ ] ) ;
double ReadLE Double ( ) ;
void ReadLE Double ( int count , double values [ ] ) ;
float ReadBE Float ( ) ;
void WriteLE Float ( float value ) ;
void WriteLE Float ( int count , const float values [ ] ) ;
void WriteLE Double ( double value ) ;
void WriteLE Double ( int count , const double values [ ] ) ;
void WriteBE Float ( float value ) ;
/* Overloaded Begin (Float)*/
void ReadSwap ( float * value ) { * value = ReadSwap Float ( ) ; }
void ReadSwap ( int count , float values [ ] ) { ReadSwap Float ( count , values ) ; }
void ReadSwap ( double * value ) { * value = ReadSwap Double ( ) ; }
void ReadSwap ( int count , double values [ ] ) { ReadSwap Double ( count , values ) ; }
void ReadLE ( float * value ) { * value = ReadLE Float ( ) ; }
void ReadLE ( int count , float values [ ] ) { ReadLE Float ( count , values ) ; }
void ReadLE ( double * value ) { * value = ReadLE Double ( ) ; }
void ReadLE ( int count , double values [ ] ) { ReadLE Double ( count , values ) ; }
# ifdef STREAM_LOGGER
// Begin LogReadSwap s
virtual void LogReadSwap ( float * value , const char * desc ) { ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , float values [ ] , const char * desc ) { ReadSwap ( count , values ) ; }
virtual void LogReadSwap ( double * value , const char * desc ) { ReadSwap ( value ) ; }
virtual void LogReadSwap Array ( int count , double values [ ] , const char * desc ) { ReadSwap ( count , values ) ; }
// End LogReadSwap s
// Begin LogReadLE s
virtual void LogReadLE ( float * value , const char * desc ) { ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , float values [ ] , const char * desc ) { ReadLE ( count , values ) ; }
virtual void LogReadLE ( double * value , const char * desc ) { ReadLE ( value ) ; }
virtual void LogReadLE Array ( int count , double values [ ] , const char * desc ) { ReadLE ( count , values ) ; }
// End LogReadLE s
# endif
void WriteSwap ( float value ) { WriteSwap Float ( value ) ; }
void WriteSwap ( int count , const float values [ ] ) { WriteSwap Float ( count , values ) ; }
void WriteSwap ( double value ) { WriteSwap Double ( value ) ; }
void WriteSwap ( int count , const double values [ ] ) { WriteSwap Double ( count , values ) ; }
void WriteLE ( float value ) { WriteLE Float ( value ) ; }
void WriteLE ( int count , const float values [ ] ) { WriteLE Float ( count , values ) ; }
void WriteLE ( double value ) { WriteLE Double ( value ) ; }
void WriteLE ( int count , const double values [ ] ) { WriteLE Double ( count , values ) ; }
/* Overloaded End */
# endif
# if HS_SCALAR_IS_FIXED
hsFixed ReadSwap Scalar( ) { return ( hsFixed ) this - > ReadSwap 32 ( ) ; }
void ReadSwap Scalar ( int count , hsFixed values [ ] )
{
this - > ReadSwap 32 ( count , ( UInt32 * ) values ) ;
}
hsFixed ReadUnswap Scalar( ) { return ( hsFixed ) this - > ReadUnswap 32 ( ) ; }
hsFixed ReadLE Scalar ( ) { return ( hsFixed ) this - > ReadLE 32 ( ) ; }
void ReadLE Scalar ( int count , hsFixed values [ ] )
{
this - > ReadLE 32 ( count , ( UInt32 * ) values ) ;
}
hsFixed ReadBE Scalar ( ) { return ( hsFixed ) this - > ReadBE 32 ( ) ; }
void WriteSwap Scalar ( hsFixed value ) { this - > WriteSwap 32 ( value ) ; }
void WriteSwap Scalar ( int count , const hsFixed values [ ] )
{
this - > WriteSwap 32 ( count , ( UInt32 * ) values ) ;
}
void WriteUnswap Scalar ( hsFixed value ) { this - > WriteUnswap 32 ( value ) ; }
void WriteLE Scalar ( hsFixed value ) { this - > WriteLE 32 ( value ) ; }
void WriteLE Scalar ( int count , const hsFixed values [ ] )
{
this - > WriteLE 32 ( count , ( UInt32 * ) values ) ;
}
void WriteBE Scalar ( hsFixed value ) { this - > WriteBE 32 ( value ) ; }
/* Overloaded Begin (Scalar) */
void ReadSwap ( hsFixed * value ) { this - > ReadSwap ( ( UInt32 * ) value ) ; }
void ReadSwap ( int count , hsFixed values [ ] ) { this - > ReadSwap ( count , ( UInt32 * ) values ) ; }
void WriteSwap ( hsFixed value ) { this - > WriteSwap ( ( UInt32 ) value ) ; }
void WriteSwap ( int count , const hsFixed values [ ] ) { this - > WriteSwap ( count , ( UInt32 * ) values ) ; }
void ReadLE ( hsFixed * value ) { this - > ReadLE ( ( UInt32 * ) value ) ; }
void ReadLE ( int count , hsFixed values [ ] ) { this - > ReadLE ( count , ( UInt32 * ) values ) ; }
void WriteLE ( hsFixed value ) { this - > WriteLE ( ( UInt32 ) value ) ; }
void WriteLE ( int count , const hsFixed values [ ] ) { this - > WriteLE ( count , ( UInt32 * ) values ) ; }
/* Overloaded End */
# else
float ReadSwap Scalar ( ) { return ( float ) this - > ReadSwap Float ( ) ; }
void ReadSwap Scalar ( int count , float values [ ] )
{
this - > ReadSwap Float ( count , ( float * ) values ) ;
}
float ReadUnswap Scalar ( ) { return ( float ) this - > ReadUnswap Float ( ) ; }
void WriteSwap Scalar ( float value ) { this - > WriteSwap Float ( value ) ; }
void WriteSwap Scalar ( int count , const float values [ ] )
{
this - > WriteSwap Float ( count , ( float * ) values ) ;
}
void WriteUnswap Scalar ( float value ) { this - > WriteUnswap Float ( value ) ; }
float ReadLE Scalar ( ) { return ( float ) this - > ReadLE Float ( ) ; }
void ReadLE Scalar ( int count , float values [ ] )
{
this - > ReadLE Float ( count , ( float * ) values ) ;
}
float ReadBE Scalar ( ) { return ( float ) this - > ReadBE Float ( ) ; }
void WriteLE Scalar ( float value ) { this - > WriteLE Float ( value ) ; }
void WriteLE Scalar ( int count , const float values [ ] )
{
this - > WriteLE Float ( count , ( float * ) values ) ;
}
void WriteBE Scalar ( float value ) { this - > WriteBE Float ( value ) ; }
# endif
void WriteSwap Atom ( UInt32 tag , UInt32 size ) ;
UInt32 ReadSwap Atom( UInt32 * size ) ;
void WriteLE Atom ( UInt32 tag , UInt32 size ) ;
UInt32 ReadLE Atom ( UInt32 * size ) ;
/* Overloaded Begin (Atom)*/
void WriteSwap ( UInt32 * tag , UInt32 size ) { WriteSwap Atom ( * tag , size ) ; }
void ReadSwap ( UInt32 * tag , UInt32 * size ) { * tag = ReadSwap Atom ( size ) ; }
void WriteLE ( UInt32 * tag , UInt32 size ) { WriteLE Atom ( * tag , size ) ; }
void ReadLE ( UInt32 * tag , UInt32 * size ) { * tag = ReadLE Atom ( size ) ; }
/* Overloaded End */
virtual void VirtualSetPosition ( UInt32 pos , VDB_Type ) { SetPosition ( pos ) ; } ;
virtual hsPackFileSys : : FileEntry * GetFileEntry ( ) { return nil ; } // Streams from Packfiles can return a FileEntry