![]() |
CMGDK r49-rc2
|
位队列 更多...
#include <BitArray.H>
公有成员 | |
BitArray (int=0) | |
BitArray (void *, int, bool=true) | |
~BitArray () | |
void | Create (int) |
创建数据区 | |
void | MapData (void *, int) |
映射数据 | |
void | Clear () |
清除所有数据 | |
void | Fill (bool) |
填充数据 | |
bool | WriteZero () |
写入一位0 | |
bool | WriteOne () |
写入一位1 | |
bool | WriteTrue () |
写入一位真(即1) | |
bool | WriteFalse () |
写入一位假(即0) | |
bool | WriteBit (bool bit) |
bool | WriteByte (unsigned __int8 *, int) |
按字节写入数据 | |
bool | ReadBit (bool &) |
读取一位 | |
bool | FlipBit () |
翻转一位 | |
bool | FlipBit (int o) |
bool | ReadPos (int o, bool &bit) const |
读取指定位 | |
bool | WritePos (int o, bool bit) |
写入一位数据 | |
bool | SaveToStream (Stream *) |
保存当前位阵列数据到流 | |
bool | LoadFromStream (Stream *) |
从流中读取位阵列数据 | |
bool | SaveToFile (const wchar_t *) |
保存当前位阵列数据到文件 | |
bool | LoadFromFile (const wchar_t *) |
从文件中读取位阵列数据 | |
BitArray & | operator= (const BitArray &) |
=号重载 | |
BitArray & | operator+= (const BitArray &) |
+ | |
BitArray & | operator-= (const BitArray &) |
BitArray & | operator*= (const BitArray &) |
* | |
bool | operator== (const BitArray &) const |
bool | operator!= (const BitArray &rhs) const |
公有属性 | |
Property< int > | Count |
数据长度 | |
Property< int > | ByteSize |
字节长度 | |
Property< int > | Position |
当前位置 | |
Property< uint8 * > | Data |
数据 |
位队列
位队列用于处理需要按位保存的数据,它可以按位读取和写入
hgl::BitArray::BitArray | ( | int | bitsize = 0 | ) |
本类构造函数,并创建指定长度的数据空间
bitsize | 位长度 |
hgl::BitArray::BitArray | ( | void * | bytedata, |
int | size, | ||
bool | map = true |
||
) |
本类构造函数,并传入部分数据,做为已有的数据
bytedata | 原有的数据 |
size | 数据字节数 |
是否是映射的其它数据区,如果为true,则在本类被清除时不会释放数据区 |
hgl::BitArray::~BitArray | ( | ) |
void hgl::BitArray::Clear | ( | ) |
清除所有数据
void hgl::BitArray::Create | ( | int | bitsize | ) |
创建数据区
创建指定长度的数据空间
bitsize | 位长度 |
void hgl::BitArray::Fill | ( | bool | v | ) |
填充数据
全部填充成指定数据
bool hgl::BitArray::FlipBit | ( | ) |
翻转一位
翻转一位数据,将指0变1,1变0
bool hgl::BitArray::FlipBit | ( | int | o | ) | [inline] |
o | 翻转指定位 |
bool hgl::BitArray::LoadFromFile | ( | const wchar_t * | filename | ) |
从文件中读取位阵列数据
bool hgl::BitArray::LoadFromStream | ( | Stream * | str | ) |
从流中读取位阵列数据
void hgl::BitArray::MapData | ( | void * | bytedata, |
int | size | ||
) |
映射数据
bool hgl::BitArray::operator!= | ( | const BitArray & | rhs | ) | const [inline] |
bool hgl::BitArray::operator== | ( | const BitArray & | rhs | ) | const |
bool hgl::BitArray::ReadBit | ( | bool & | bit | ) |
读取一位
从位队列中读取一位
bit | 读取出来的位数据 |
bool hgl::BitArray::ReadPos | ( | int | off, |
bool & | bit | ||
) | const |
读取指定位
从位队列中读取一位
off | 位置 |
bit | 读取出来的位数据 |
bool hgl::BitArray::SaveToFile | ( | const wchar_t * | filename | ) |
保存当前位阵列数据到文件
bool hgl::BitArray::SaveToStream | ( | Stream * | str | ) |
保存当前位阵列数据到流
bool hgl::BitArray::WriteBit | ( | bool | bit | ) | [inline] |
bit | 写入一位数据 |
bool hgl::BitArray::WriteByte | ( | unsigned __int8 * | bytedata, |
int | size | ||
) |
按字节写入数据
按字节向队列写入数据
bytedata | 字节数据 |
size | 字节长度 |
bool hgl::BitArray::WriteFalse | ( | ) | [inline] |
写入一位假(即0)
bool hgl::BitArray::WriteOne | ( | ) |
写入一位1
向位队列中写入一位1
bool hgl::BitArray::WritePos | ( | int | off, |
bool | bit | ||
) |
写入一位数据
向位队列中写入一位数据
off | 位置 |
bit | 数据 |
bool hgl::BitArray::WriteTrue | ( | ) | [inline] |
写入一位真(即1)
bool hgl::BitArray::WriteZero | ( | ) |
写入一位0
向位队列中写入一位0
数据长度
数据