1 #ifndef _BITSTREAM_H_ 2 #define _BITSTREAM_H_ 3 4 #include "Types.h" 5 #include <stdexcept> 6 7 namespace Framework 8 { 9 class CBitStream 10 { 11 public: 12 class CBitStreamException : public std::exception 13 { 14 public: 15 16 private: 17 18 }; 19 ~CBitStream()20 virtual ~CBitStream() {}; 21 22 virtual void Advance(uint8) = 0; 23 virtual uint8 GetBitIndex() const = 0; 24 25 virtual bool TryPeekBits_LSBF(uint8, uint32&) = 0; 26 virtual bool TryPeekBits_MSBF(uint8, uint32&) = 0; 27 28 bool TryGetBits_LSBF(uint8, uint32&); 29 bool TryGetBits_MSBF(uint8, uint32&); 30 31 uint32 GetBits_LSBF(uint8); 32 uint32 GetBits_MSBF(uint8); 33 34 uint32 PeekBits_LSBF(uint8); 35 uint32 PeekBits_MSBF(uint8); 36 37 void SeekToByteAlign(); 38 bool IsOnByteBoundary() const; 39 }; 40 } 41 42 #endif