--- libgig/trunk/src/RIFF.h 2007/05/17 17:08:29 1193 +++ libgig/trunk/src/RIFF.h 2009/03/22 11:13:25 1869 @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -52,17 +53,23 @@ # include #endif // POSIX +#ifdef _MSC_VER +// Visual C++ 2008 doesn't have stdint.h +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#else #include +#endif #ifdef WIN32 -# include "../win32/libgig_private.h" // like config.h, automatically generated by Dev-C++ # include typedef unsigned int uint; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -# define PACKAGE "libgig" -# define VERSION VER_STRING // VER_STRING defined in libgig_private.h #endif // WIN32 #include @@ -148,12 +155,12 @@ public: Chunk(File* pFile, unsigned long StartPos, List* Parent); String GetChunkIDString(); - uint32_t GetChunkID() { return ChunkID; }; ///< Chunk ID in unsigned integer representation. - List* GetParent() { return pParent; }; ///< Returns pointer to the chunk's parent list chunk. - unsigned long GetSize() { return CurrentChunkSize; }; ///< Chunk size in bytes (without header, thus the chunk data body) - unsigned long GetNewSize() { return NewChunkSize; }; ///< New chunk size if it was modified with Resize(). - unsigned long GetPos() { return ulPos; }; ///< Position within the chunk data body - unsigned long GetFilePos() { return ulStartPos + ulPos; }; ///< Current, actual offset in file. + uint32_t GetChunkID() { return ChunkID; } ///< Chunk ID in unsigned integer representation. + List* GetParent() { return pParent; } ///< Returns pointer to the chunk's parent list chunk. + unsigned long GetSize() { return CurrentChunkSize; } ///< Chunk size in bytes (without header, thus the chunk data body) + unsigned long GetNewSize() { return NewChunkSize; } ///< New chunk size if it was modified with Resize(). + unsigned long GetPos() { return ulPos; } ///< Position within the chunk data body + unsigned long GetFilePos() { return ulStartPos + ulPos; } ///< Current, actual offset in file. unsigned long SetPos(unsigned long Where, stream_whence_t Whence = stream_start); unsigned long RemainingBytes(); stream_state_t GetState(); @@ -277,6 +284,7 @@ void LoadSubChunksRecursively(); virtual unsigned long WriteChunk(unsigned long ulWritePos, unsigned long ulCurrentDataOffset); virtual void __resetPos(); ///< Sets List Chunk's read/write position to zero and causes all sub chunks to do the same. + void DeleteChunkList(); }; /** @brief RIFF File @@ -316,7 +324,7 @@ friend class List; private: stream_mode_t Mode; - ChunkList ResizedChunks; ///< All chunks which have been resized (enlarged / shortened). + std::set ResizedChunks; ///< All chunks which have been resized (enlarged / shortened). unsigned long GetFileSize(); void ResizeFile(unsigned long ulNewSize); @@ -336,9 +344,9 @@ public: String Message; - Exception(String Message) { Exception::Message = Message; }; + Exception(String Message) { Exception::Message = Message; } void PrintMessage(); - virtual ~Exception() {}; + virtual ~Exception() {} }; String libraryName();