2023-04-27 22:19:39 -04:00
|
|
|
#ifndef MXDSFILE_H
|
|
|
|
#define MXDSFILE_H
|
|
|
|
|
2023-06-27 14:44:02 -04:00
|
|
|
#include "mxcore.h"
|
|
|
|
#include "mxstring.h"
|
|
|
|
#include "mxioinfo.h"
|
|
|
|
#include "mxdssource.h"
|
2023-06-27 22:04:07 -04:00
|
|
|
|
2023-06-27 14:44:02 -04:00
|
|
|
class MxDSFile : public MxDSSource
|
2023-04-27 22:19:39 -04:00
|
|
|
{
|
|
|
|
public:
|
2023-06-27 14:44:02 -04:00
|
|
|
__declspec(dllexport) MxDSFile(const char *filename, unsigned long skipReadingChunks);
|
2023-06-11 21:03:54 -04:00
|
|
|
__declspec(dllexport) virtual ~MxDSFile();
|
|
|
|
__declspec(dllexport) virtual long Open(unsigned long);
|
2023-06-27 14:44:02 -04:00
|
|
|
__declspec(dllexport) virtual long Close();
|
2023-06-11 21:03:54 -04:00
|
|
|
__declspec(dllexport) virtual long Read(unsigned char *,unsigned long);
|
|
|
|
__declspec(dllexport) virtual long Seek(long,int);
|
2023-06-27 14:44:02 -04:00
|
|
|
__declspec(dllexport) virtual unsigned long GetBufferSize();
|
|
|
|
__declspec(dllexport) virtual unsigned long GetStreamBuffersNum();
|
|
|
|
|
2023-06-19 01:36:07 -04:00
|
|
|
private:
|
2023-06-27 14:44:02 -04:00
|
|
|
long ReadChunks();
|
|
|
|
struct ChunkHeader {
|
|
|
|
ChunkHeader()
|
|
|
|
: majorVersion(0)
|
|
|
|
, minorVersion(0)
|
|
|
|
, bufferSize(0)
|
|
|
|
, streamBuffersNum(0)
|
|
|
|
{}
|
|
|
|
|
|
|
|
unsigned short majorVersion;
|
|
|
|
unsigned short minorVersion;
|
|
|
|
unsigned long bufferSize;
|
|
|
|
short streamBuffersNum;
|
|
|
|
short reserved;
|
|
|
|
};
|
|
|
|
|
|
|
|
MxString m_filename;
|
|
|
|
MXIOINFO m_io;
|
|
|
|
ChunkHeader m_header;
|
|
|
|
|
|
|
|
// If false, read chunks immediately on open, otherwise
|
|
|
|
// skip reading chunks until ReadChunks is explicitly called.
|
|
|
|
unsigned long m_skipReadingChunks;
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXDSFILE_H
|