Mercurial > dedupe
diff BitDecoder.hpp @ 45:41cc0d8ac77f
Decode directly from bitString.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 10 Sep 2012 21:29:43 +0200 |
| parents | f711ddb56ae7 |
| children | f8d0ea827db3 |
line wrap: on
line diff
--- a/BitDecoder.hpp Mon Sep 10 19:18:30 2012 +0200 +++ b/BitDecoder.hpp Mon Sep 10 21:29:43 2012 +0200 @@ -13,7 +13,7 @@ private: BitDecoder(BitDecoder* low_in, BitDecoder* high_in); - uint decode(QString& resString, const QBitArray& bits, uint offset) + uint decode(QString& resString, const QBitArray& bits, uint offset) const { //Data is always stored in a leaf node. if (high) { @@ -30,7 +30,7 @@ ~BitDecoder(); const QString& data() const; - QString decode(const QBitArray& bits) + QString decode(const QBitArray& bits) const { QString combined; uint n = bits.size(); @@ -40,8 +40,11 @@ combined.squeeze(); return combined; } + QString decode(const QString& bits) const; static BitDecoder* merge(BitDecoder* low, BitDecoder* high); + static QBitArray bitsFromString(const QString& str); + static QBitArray unite(const QBitArray& first, const QBitArray& second) { int n = first.size();
