78 |
|
|
79 |
/** Whether file stream is open in read or in read/write mode. */ |
/** Whether file stream is open in read or in read/write mode. */ |
80 |
typedef enum { |
typedef enum { |
81 |
stream_mode_read, |
stream_mode_read = 0, |
82 |
stream_mode_read_write |
stream_mode_read_write = 1, |
83 |
|
stream_mode_closed = 2 |
84 |
} stream_mode_t; |
} stream_mode_t; |
85 |
|
|
86 |
/** Current state of the file stream. */ |
/** Current state of the file stream. */ |
145 |
unsigned long ulStartPos; /* actual position in file where chunk (without header) starts */ |
unsigned long ulStartPos; /* actual position in file where chunk (without header) starts */ |
146 |
unsigned long ulPos; /* # of bytes from ulStartPos */ |
unsigned long ulPos; /* # of bytes from ulStartPos */ |
147 |
uint8_t* pChunkData; |
uint8_t* pChunkData; |
148 |
|
unsigned long ulChunkDataSize; |
149 |
|
|
150 |
Chunk(File* pFile); |
Chunk(File* pFile); |
151 |
Chunk(File* pFile, List* pParent, uint32_t uiChunkID, uint uiBodySize); |
Chunk(File* pFile, List* pParent, uint32_t uiChunkID, uint uiBodySize); |
231 |
/** Parses arbitrary RIFF files and provides together with it's base classes convenient methods to walk through the RIFF tree. */ |
/** Parses arbitrary RIFF files and provides together with it's base classes convenient methods to walk through the RIFF tree. */ |
232 |
class File : public List { |
class File : public List { |
233 |
public: |
public: |
234 |
File(); |
File(uint32_t FileType); |
235 |
File(const String& path); |
File(const String& path); |
236 |
stream_mode_t GetMode(); |
stream_mode_t GetMode(); |
237 |
bool SetMode(stream_mode_t NewMode); |
bool SetMode(stream_mode_t NewMode); |
259 |
|
|
260 |
unsigned long GetFileSize(); |
unsigned long GetFileSize(); |
261 |
void ResizeFile(unsigned long ulNewSize); |
void ResizeFile(unsigned long ulNewSize); |
262 |
|
#if POSIX |
263 |
|
unsigned long __GetFileSize(int hFile); |
264 |
|
#else |
265 |
|
unsigned long __GetFileSize(FILE* hFile); |
266 |
|
#endif |
267 |
}; |
}; |
268 |
|
|
269 |
/** Will be thrown whenever an error occurs while parsing a RIFF file. */ |
/** Will be thrown whenever an error occurs while parsing a RIFF file. */ |