Refactor project structure
This commit is contained in:
29
core/anslicensing/bitstream.h
Normal file
29
core/anslicensing/bitstream.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class BitStream
|
||||
{
|
||||
public:
|
||||
BitStream(int bitSize = 0);
|
||||
BitStream(vector<unsigned char>& buf, int bitSize);
|
||||
|
||||
|
||||
bool Create(int sizeInBits);
|
||||
void Attach(vector<unsigned char>& buf, int sizeInBits);
|
||||
int Read(void *bitPtr, int countInBits);
|
||||
int Write(const void * bitPtr, int countInBits);
|
||||
int Seek(int offset, bool relative = false);
|
||||
int GetSize();
|
||||
void ZeroPadToNextByte();
|
||||
void * GetBuffer(int * sizeInBits = NULL);
|
||||
void ReleaseBuffer(int bitCount);
|
||||
void Clear();
|
||||
|
||||
protected:
|
||||
vector<unsigned char> m_buf;
|
||||
int m_bufBits;
|
||||
int m_currentBitIndex;
|
||||
};
|
||||
Reference in New Issue
Block a user