• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_COMMON_BC_COMMONBITARRAY_H_
8 #define FXBARCODE_COMMON_BC_COMMONBITARRAY_H_
9 
10 #include <stdint.h>
11 
12 #include <vector>
13 
14 class CBC_CommonBitArray {
15  public:
16   explicit CBC_CommonBitArray(CBC_CommonBitArray* array);
17   explicit CBC_CommonBitArray(int32_t size);
18   CBC_CommonBitArray();
19   virtual ~CBC_CommonBitArray();
20 
21   size_t GetSize();
22   size_t GetSizeInBytes();
23   std::vector<int32_t>& GetBits();
24   int32_t* GetBitArray();
25   bool Get(size_t i);
26   void Set(size_t i);
27   void Flip(size_t i);
28   void SetBulk(size_t i, int32_t newBits);
29   void Reverse();
30   void Clear();
31 
32  private:
33   size_t m_size;
34   std::vector<int32_t> m_bits;
35 };
36 
37 #endif  // FXBARCODE_COMMON_BC_COMMONBITARRAY_H_
38