22 #ifndef MEDIASTATION_DATAFILE_H 23 #define MEDIASTATION_DATAFILE_H 25 #include "common/file.h" 26 #include "common/stream.h" 27 #include "common/path.h" 28 #include "common/rect.h" 29 #include "common/str.h" 52 kDatumTypeEmpty = 0x00,
53 kDatumTypeUint8 = 0x02,
54 kDatumTypeUint16 = 0x03,
55 kDatumTypeUint32 = 0x04,
56 kDatumTypeInt8 = 0x05,
57 kDatumTypeInt16 = 0x06,
58 kDatumTypeInt32 = 0x07,
59 kDatumTypeFloat = 0x08,
60 kDatumTypeDouble = 0x09,
61 kDatumTypeFilename = 0x0a,
62 kDatumTypeRect = 0x0d,
63 kDatumTypePoint = 0x0e,
64 kDatumTypeGraphicSize = 0x0f,
65 kDatumTypeGraphicUnit = 0x10,
66 kDatumTypeTime = 0x11,
67 kDatumTypeString = 0x12,
68 kDatumTypeVersion = 0x13,
69 kDatumTypeChunkReference = 0x1b,
70 kDatumTypePolygon = 0x1d,
71 kDatumTypePalette = 0x05aa
81 uint16 readTypedUint16();
82 uint32 readTypedUint32();
83 int8 readTypedSByte();
84 int16 readTypedSint16();
85 int32 readTypedSint32();
86 float readTypedFloat();
87 double readTypedDouble();
92 int16 readTypedGraphicUnit();
93 double readTypedTime();
96 uint32 readTypedChunkReference();
97 Polygon readTypedPolygon();
100 void readAndVerifyType(DatumType type);
108 uint32 bytesRemaining();
114 virtual bool eos()
const {
return _parentStream->eos(); };
115 virtual bool err()
const {
return _parentStream->err(); };
116 virtual void clearErr() { _parentStream->clearErr(); };
117 virtual uint32 read(
void *dataPtr, uint32 dataSize);
118 virtual int64
pos()
const {
return _parentStream->pos(); };
119 virtual int64
size()
const {
return _parentStream->size(); };
120 virtual bool skip(uint32 offset) {
return seek(offset, SEEK_CUR); };
121 virtual bool seek(int64 offset,
int whence = SEEK_SET);
125 uint32 _dataStartOffset = 0;
126 uint32 _dataEndOffset = 0;