#include <BitString.h>
Public Member Functions | |
| BitString (EmbValue arity=2) | |
| BitString (const BitString &bs) | |
| BitString (const unsigned long l) | |
| BitString (const std::vector< BYTE > &d) | |
| BitString (const std::string &d) | |
| void | setArity (EmbValue arity) |
| EmbValue | getArity (void) const |
| UWORD32 | getLength (void) const |
| UWORD32 | getNAryLength (void) const |
| BitString & | clear (void) |
| BitString & | append (const BIT v) |
| BitString & | append (const BYTE v, const unsigned short n=8) |
| BitString & | append (const UWORD16 v, const unsigned short n=16) |
| BitString & | append (const UWORD32 v, const unsigned short n=32) |
| BitString & | append (const std::string &v) |
| BitString & | append (const std::vector< BYTE > &v) |
| BitString & | append (const BitString &v) |
| BitString & | setBit (unsigned long i, BIT v) |
| BitString | getBits (const unsigned long s, const unsigned long l) const |
| BitString | cutBits (const unsigned long s, const unsigned long l) |
| UWORD32 | getValue (const unsigned long s, const unsigned short l) const |
| const std::vector< BYTE > & | getBytes (void) const |
| BitString & | truncate (const unsigned long s, const unsigned long e) |
| BitString & | pad (const unsigned long mult, const BIT v) |
| BitString & | padRandom (const unsigned long mult) |
| BYTE | getNAry (unsigned long p) const |
| void | appendNAry (BYTE v) |
| BIT | operator[] (const unsigned long i) const |
| BitString & | operator^= (const BitString &v) |
| bool | operator== (const BitString &v) const |
| bool | operator!= (const BitString &v) const |
| void | print (unsigned short spc=0) const |
Private Member Functions | |
| void | _append (BIT v) |
| void | clearUnused (void) |
Private Attributes | |
| UWORD32 | Length |
| the number of bits in Data | |
| EmbValue | Arity |
| the arity that will be used for getLength/getNAry/appendNAry | |
| unsigned short | ArityNBits |
| the number of Bits per n-ary digit (where n is Arity) | |
| std::vector< BYTE > | Data |
| the actual data | |
For data storage a vector of BYTEs is used with little endian bit encoding, i.e. the first bit is the least significant bit of the first byte and so on.
|
|
construct an empty BitString |
|
|
copy constructor |
|
|
construct a BitString containing l bits with value zero |
|
|
construct a BitString containing the data in d |
|
|
construct a BitString containing the characters in d as 8 bit unsigned chars |
|
|
|
|
|
append the BitString v to this BitString
|
|
|
append the vector v byte-wise to this BitString |
|
|
append the string v to this BitString |
|
||||||||||||
|
append n lower order bits of v to this BitString
|
|
||||||||||||
|
append n lower order bits of v to this BitString
|
|
||||||||||||
|
append n lower order bits of v to this BitString
|
|
|
append the bit v to this BitString |
|
|
append an n-ary digit to this BitString
|
|
|
delete the contents of this Bitstring |
|
|
clear unused part of last byte (_append depends on this) |
|
||||||||||||
|
cut some bits out of this BitString
|
|
|
|
|
||||||||||||
|
get a BitString that is a part of this BitString
|
|
|
get the contents of this BitString as vector of bytes
|
|
|
get the number of bits in this BitString |
|
|
get an n-ary digit from this BitString
|
|
|
get the number of EmbValues in this BitString (using this BitString's arity) |
|
||||||||||||
|
return a value composed from bits in this BitString
|
|
|
compare this BitString with the BitString v
|
|
|
compare this BitString with the BitString v
|
|
|
get the value of the i-th bit |
|
|
xor v with this BitString, saving the result in this Bitstring. The result has the same length as this BitString. |
|
||||||||||||
|
pad this BitString with the value in v
|
|
|
pad this BitString with random data
|
|
|
|
|
|
|
|
||||||||||||
|
set the p-th bit to v
|
|
||||||||||||
|
truncate this BitString
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.7