kget
#include <bitset.h>
Simple implementation of a BitSet.
- Author
- Joris Guisson Simple implementation of a BitSet, can only turn on and off bits. BitSet's are used to indicate which chunks we have or not.
Definition at line 32 of file bitset.h.
BitSet::BitSet |
( |
quint32 |
num_bits = 8 | ) |
|
Constructor.
- Parameters
-
num_bits | The number of bits |
Definition at line 26 of file bitset.cpp.
BitSet::BitSet |
( |
const quint8 * |
data, |
|
|
quint32 |
num_bits |
|
) |
| |
Manually set data.
- Parameters
-
data | The data |
num_bits | The number of bits |
Definition at line 34 of file bitset.cpp.
BitSet::BitSet |
( |
const BitSet & |
bs | ) |
|
Copy constructor.
- Parameters
-
- Returns
Definition at line 49 of file bitset.cpp.
bool BitSet::allOff |
( |
| ) |
const |
bool BitSet::allOn |
( |
| ) |
const |
Check if all bit are set to 1.
Definition at line 127 of file bitset.cpp.
bool BitSet::get |
( |
quint32 |
i | ) |
const |
|
inline |
Get the value of a bit, false means 0, true 1.
- Parameters
-
Definition at line 139 of file bitset.h.
void BitSet::getContinuousRange |
( |
qint32 * |
start, |
|
|
qint32 * |
end, |
|
|
bool |
on |
|
) |
| |
Finds a continous rang of bits that on/off.
- Parameters
-
start | here the start bit will be stored, -1 if nothing is found |
end | stores the end bit, -1 if nothing is found |
on | wether a continous range of bits on (set) or off (not set) should be searched for |
Definition at line 80 of file bitset.cpp.
const quint8* BitSet::getData |
( |
| ) |
const |
|
inline |
quint8* BitSet::getData |
( |
| ) |
|
|
inline |
quint32 BitSet::getNumBits |
( |
| ) |
const |
|
inline |
quint32 BitSet::getNumBytes |
( |
| ) |
const |
|
inline |
bool BitSet::isNull |
( |
| ) |
const |
|
inline |
quint32 BitSet::numOnBits |
( |
| ) |
const |
|
inline |
Get the number of on bits.
Definition at line 92 of file bitset.h.
bool BitSet::operator!= |
( |
const BitSet & |
bs | ) |
|
|
inline |
Opposite of operator ==.
Definition at line 134 of file bitset.h.
Assignment operator.
- Parameters
-
- Returns
- *this
Definition at line 62 of file bitset.cpp.
bool BitSet::operator== |
( |
const BitSet & |
bs | ) |
|
Check for equality of bitsets.
- Parameters
-
- Returns
- true if equal
Definition at line 137 of file bitset.cpp.
void BitSet::orBitSet |
( |
const BitSet & |
other | ) |
|
void BitSet::set |
( |
quint32 |
i, |
|
|
bool |
on |
|
) |
| |
|
inline |
Set the value of a bit, false means 0, true 1.
- Parameters
-
i | Index of Bit |
on | False means 0, true 1 |
Definition at line 150 of file bitset.h.
void BitSet::setAll |
( |
bool |
on | ) |
|
Set all bits on or off.
Definition at line 74 of file bitset.cpp.
void BitSet::setRange |
( |
quint32 |
start, |
|
|
quint32 |
end, |
|
|
bool |
value |
|
) |
| |
|
inline |
Sets the value of a range of bits.
- Parameters
-
start | of the range |
end | of the range |
value | to set the range to |
Definition at line 170 of file bitset.h.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.