added appendBitArray to BitArray

This commit is contained in:
favoritas37 2015-06-18 23:48:53 +03:00
parent e6e82548ab
commit 84d3f773ba
2 changed files with 10 additions and 0 deletions

View File

@ -179,6 +179,15 @@ void BitArray::appendBits(int value, int numBits)
}
}
void BitArray::appendBitArray(const BitArray& other)
{
int otherSize = other.size;
ensureCapacity(size + otherSize);
for (int i = 0; i < otherSize; i++) {
appendBit(other.get(i));
}
}
void BitArray::ensureCapacity(int size)
{
if (size > bits->size() * 32)

View File

@ -64,6 +64,7 @@ public:
void appendBit(bool bit);
void appendBits(int value, int numBits);
void appendBitArray(const BitArray& other);
void ensureCapacity(int size);
void xor_(const BitArray& other);