diff options
author | weili <weili@chromium.org> | 2016-08-09 13:45:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 13:45:03 -0700 |
commit | e76203dbefd1df075a063ee019c3908513f6bee5 (patch) | |
tree | 2a763852e1d1de3eee6a67285ea96be2874bfb00 /xfa/fxbarcode/qrcode/BC_QRCoderMode.h | |
parent | ad5ac7584844b03c5ceed082e5f5158a632405cc (diff) | |
download | pdfium-e76203dbefd1df075a063ee019c3908513f6bee5.tar.xz |
Use smart pointers for class owned pointers in xfa/fxbarcode
For classes under xfa/fxbarcode, use smart pointers instead
of raw pointer to make memory management easier.
Also fix some styling issues along the changes.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2221023003
Diffstat (limited to 'xfa/fxbarcode/qrcode/BC_QRCoderMode.h')
-rw-r--r-- | xfa/fxbarcode/qrcode/BC_QRCoderMode.h | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderMode.h b/xfa/fxbarcode/qrcode/BC_QRCoderMode.h index 91a991f898..63048dca43 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderMode.h +++ b/xfa/fxbarcode/qrcode/BC_QRCoderMode.h @@ -9,24 +9,25 @@ #include <stdint.h> +#include <vector> + #include "core/fxcrt/include/fx_string.h" class CBC_QRCoderVersion; class CBC_QRCoderMode { - private: - int32_t* m_characterCountBitsForVersions; - int32_t m_bits; - CFX_ByteString m_name; - CBC_QRCoderMode(int32_t* characterCountBitsForVersions, - int32_t x1, - int32_t x2, - int32_t x3, - int32_t bits, - CFX_ByteString name); - CBC_QRCoderMode(); - public: + virtual ~CBC_QRCoderMode(); + + static void Initialize(); + static void Finalize(); + static CBC_QRCoderMode* ForBits(int32_t bits, int32_t& e); + static void Destroy(); + + int32_t GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t& e) const; + int32_t GetBits() const; + CFX_ByteString GetName() const; + static CBC_QRCoderMode* sBYTE; static CBC_QRCoderMode* sNUMERIC; static CBC_QRCoderMode* sALPHANUMERIC; @@ -37,15 +38,16 @@ class CBC_QRCoderMode { static CBC_QRCoderMode* sFNC1_FIRST_POSITION; static CBC_QRCoderMode* sFNC1_SECOND_POSITION; static CBC_QRCoderMode* sSTRUCTURED_APPEND; - virtual ~CBC_QRCoderMode(); - static void Initialize(); - static void Finalize(); - static CBC_QRCoderMode* ForBits(int32_t bits, int32_t& e); - int32_t GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t& e); - int32_t GetBits(); - CFX_ByteString GetName(); - static void Destroy(); + private: + CBC_QRCoderMode(); + CBC_QRCoderMode(std::vector<int32_t> charCountBits, + int32_t bits, + CFX_ByteString name); + + std::vector<int32_t> m_characterCountBitsForVersions; + const int32_t m_bits; + const CFX_ByteString m_name; }; #endif // XFA_FXBARCODE_QRCODE_BC_QRCODERMODE_H_ |