GAF Library
Generic Animation Format
 All Classes Functions Pages
GAFStream.h
1 #pragma once
2 
3 #include "TagDefines.h"
4 
5 class GAFFile;
6 
7 class GAFStream
8 {
9 private:
10  GAFFile* m_input;
11  unsigned char m_currentByte;
12  unsigned char m_unusedBits;
13 
14  struct TagRecord
15  {
16  unsigned int expectedStreamPos;
17  unsigned int tagSize;
18  Tags::Enum tagType;
19  };
20 
21  typedef std::stack<TagRecord> TagStack_t;
22  TagStack_t m_tagStack;
23 
24 public:
25  GAFStream(GAFFile* input);
26  ~GAFStream();
27 
28  void readNBytesOfT(void* dest, unsigned int);
29  bool readBool();
30  unsigned int readUint(unsigned short bitcount);
31  int readSint(unsigned short bitcount);
32  float readFixed();
33  float readFixed8();
34 
35  float readFloat();
36 
37  unsigned char readUByte();
38  char readSByte();
39 
40  unsigned char readU8() { return readUByte(); }
41  char readS8() { return readSByte(); }
42  unsigned short readU16();
43  unsigned int readU32();
44  int readS32();
45 
46  void readString(std::string* out);
47 
48  GAFFile* getInput() const;
49 
50  Tags::Enum openTag();
51  void closeTag();
52  unsigned int getTagLenghtOnStackTop() const;
53  unsigned int getTagExpectedPosition() const;
54  unsigned int getPosition() const;
55 
56  void align();
57 
58  bool isEndOfStream() const;
59 };
Definition: GAFStream.h:7
Definition: GAFFile.h:5