diff options
| author | Mike Buland <mike@xagasoft.com> | 2024-09-30 11:50:17 -0700 |
|---|---|---|
| committer | Mike Buland <mike@xagasoft.com> | 2024-09-30 11:50:17 -0700 |
| commit | 0befcc026be9e4f6c40f8771c7f26f767ebddbf7 (patch) | |
| tree | e549bee70f50def02d24ef386b490e017bc6043b /src/unstable/bitstring.cpp | |
| parent | 84c93fbf0f371bcd26893d1c33e3a5bf1a61223e (diff) | |
| download | libbu++-0befcc026be9e4f6c40f8771c7f26f767ebddbf7.tar.gz libbu++-0befcc026be9e4f6c40f8771c7f26f767ebddbf7.tar.bz2 libbu++-0befcc026be9e4f6c40f8771c7f26f767ebddbf7.tar.xz libbu++-0befcc026be9e4f6c40f8771c7f26f767ebddbf7.zip | |
Erasing streams works, stream map building works.
Diffstat (limited to '')
| -rw-r--r-- | src/unstable/bitstring.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/unstable/bitstring.cpp b/src/unstable/bitstring.cpp index 21c1316..b80c073 100644 --- a/src/unstable/bitstring.cpp +++ b/src/unstable/bitstring.cpp | |||
| @@ -209,7 +209,7 @@ void Bu::BitString::flipBit( long iBit ) | |||
| 209 | caData[iBit/8] ^= (1<<(iBit%8)); | 209 | caData[iBit/8] ^= (1<<(iBit%8)); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | bool Bu::BitString::getBit( long iBit ) | 212 | bool Bu::BitString::getBit( long iBit ) const |
| 213 | { | 213 | { |
| 214 | if( iBit >= iBits || iBit < 0 ) return false; | 214 | if( iBit >= iBits || iBit < 0 ) return false; |
| 215 | if( (caData[iBit/8] & (1<<(iBit%8))) == 0 ) | 215 | if( (caData[iBit/8] & (1<<(iBit%8))) == 0 ) |
| @@ -224,7 +224,7 @@ long Bu::BitString::getBitLength() | |||
| 224 | return iBits; | 224 | return iBits; |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | long Bu::BitString::getSize() | 227 | long Bu::BitString::getSize() const |
| 228 | { | 228 | { |
| 229 | return iBits; | 229 | return iBits; |
| 230 | } | 230 | } |
| @@ -311,6 +311,14 @@ void Bu::BitString::clear() | |||
| 311 | } | 311 | } |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | void Bu::BitString::fill() | ||
| 315 | { | ||
| 316 | if( caData != NULL ) | ||
| 317 | { | ||
| 318 | memset( caData, 0xff, iBytes ); | ||
| 319 | } | ||
| 320 | } | ||
| 321 | |||
| 314 | bool Bu::BitString::setBitLength( long iLength, bool bClear ) | 322 | bool Bu::BitString::setBitLength( long iLength, bool bClear ) |
| 315 | { | 323 | { |
| 316 | return setSize( iLength, bClear ); | 324 | return setSize( iLength, bClear ); |
