diff options
author | Lei Zhang <thestig@chromium.org> | 2017-04-04 16:15:13 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-04 23:35:59 +0000 |
commit | b2a40475ade2fe34a406472e53787bdac5a6950a (patch) | |
tree | 70676e292db220552549a427a662a9c88241ff1a /fxbarcode/qrcode/BC_QRCoderBitVector.h | |
parent | 20a909e655147e21f966b95af6b683d85736c8c2 (diff) | |
download | pdfium-b2a40475ade2fe34a406472e53787bdac5a6950a.tar.xz |
Clean up QRCoderBitVector.
Use std::vector and return booleans results when possible.
Change-Id: If3ce4559f137fb449fd1ab818750558a1b5f8df0
Reviewed-on: https://pdfium-review.googlesource.com/3561
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode/qrcode/BC_QRCoderBitVector.h')
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderBitVector.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/fxbarcode/qrcode/BC_QRCoderBitVector.h b/fxbarcode/qrcode/BC_QRCoderBitVector.h index 59c4360c1e..0ebeb60ab8 100644 --- a/fxbarcode/qrcode/BC_QRCoderBitVector.h +++ b/fxbarcode/qrcode/BC_QRCoderBitVector.h @@ -7,29 +7,31 @@ #ifndef FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ #define FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ +#include <stddef.h> #include <stdint.h> -class CBC_QRCoderBitVector { - private: - int32_t m_sizeInBits; - uint8_t* m_array; - int32_t m_size; - - void AppendByte(int32_t value); +#include <vector> +class CBC_QRCoderBitVector { public: CBC_QRCoderBitVector(); - virtual ~CBC_QRCoderBitVector(); - int32_t At(int32_t index, int32_t& e); - int32_t Size(); - int32_t sizeInBytes(); - void AppendBit(int32_t bit, int32_t& e); - void AppendBits(int32_t value, int32_t numBits, int32_t& e); - void AppendBitVector(CBC_QRCoderBitVector* bits, int32_t& e); - void XOR(CBC_QRCoderBitVector* other, int32_t& e); - uint8_t* GetArray(); - void Clear(); - virtual void Init(); + ~CBC_QRCoderBitVector(); + + const uint8_t* GetArray() const; + int32_t At(size_t index, int32_t& e) const; + size_t Size() const; + size_t sizeInBytes() const; + + void AppendBit(int32_t bit); + void AppendBits(int32_t value, int32_t numBits); + void AppendBitVector(CBC_QRCoderBitVector* bits); + bool XOR(const CBC_QRCoderBitVector* other); + + private: + void AppendByte(int8_t value); + + size_t m_sizeInBits = 0; + std::vector<uint8_t> m_array; }; #endif // FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ |