1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ 8 #define FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 #include <vector> 14 15 class CBC_QRCoderBitVector { 16 public: 17 CBC_QRCoderBitVector(); 18 ~CBC_QRCoderBitVector(); 19 20 const uint8_t* GetArray() const; 21 int32_t At(size_t index, int32_t& e) const; 22 size_t Size() const; 23 size_t sizeInBytes() const; 24 25 void AppendBit(int32_t bit); 26 void AppendBits(int32_t value, int32_t numBits); 27 void AppendBitVector(CBC_QRCoderBitVector* bits); 28 bool XOR(const CBC_QRCoderBitVector* other); 29 30 private: 31 void AppendByte(int8_t value); 32 33 size_t m_sizeInBits = 0; 34 std::vector<uint8_t> m_array; 35 }; 36 37 #endif // FXBARCODE_QRCODE_BC_QRCODERBITVECTOR_H_ 38