diff options
author | Lei Zhang <thestig@chromium.org> | 2017-05-22 18:47:12 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-23 21:17:23 +0000 |
commit | abc83aa862050642a90ed109074a9cf1018fee9b (patch) | |
tree | b842d471c3cc49a0268a0647ca4c574248610ae9 /fxbarcode/datamatrix/BC_SymbolInfo.h | |
parent | e0f1310795f1cf886b9b2a134b28ace9e8fc25ba (diff) | |
download | pdfium-abc83aa862050642a90ed109074a9cf1018fee9b.tar.xz |
Clean up CBC_SymbolInfo.chromium/3109
- Remove rectangular ctor param. It can be derived from dimensions.
- Make members private and add accessors.
- Remove exceptions that cannot occur.
Change-Id: Iec113205241562a0559e594fe257f5b9064ed97e
Reviewed-on: https://pdfium-review.googlesource.com/5737
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix/BC_SymbolInfo.h')
-rw-r--r-- | fxbarcode/datamatrix/BC_SymbolInfo.h | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/fxbarcode/datamatrix/BC_SymbolInfo.h b/fxbarcode/datamatrix/BC_SymbolInfo.h index 0a5cd20247..18d7b68f09 100644 --- a/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -13,8 +13,7 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { public: - CBC_SymbolInfo(bool rectangular, - int32_t dataCapacity, + CBC_SymbolInfo(int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, @@ -36,27 +35,23 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { SymbolShapeHint shape, bool fail, int32_t& e); - int32_t getHorizontalDataRegions(int32_t& e); - int32_t getVerticalDataRegions(int32_t& e); - int32_t getSymbolDataWidth(int32_t& e); - int32_t getSymbolDataHeight(int32_t& e); - int32_t getSymbolWidth(int32_t& e); - int32_t getSymbolHeight(int32_t& e); - int32_t getCodewordCount(); - int32_t getInterleavedBlockCount(); - int32_t getDataLengthForInterleavedBlock(int32_t index); - int32_t getErrorLengthForInterleavedBlock(int32_t index); - int32_t m_dataCapacity; - int32_t m_errorCodewords; - int32_t m_matrixWidth; - int32_t m_matrixHeight; - int32_t m_rsBlockData; - int32_t m_rsBlockError; + int32_t getSymbolDataWidth() const; + int32_t getSymbolDataHeight() const; + int32_t getSymbolWidth() const; + int32_t getSymbolHeight() const; + int32_t getCodewordCount() const; + int32_t getInterleavedBlockCount() const; + int32_t getDataLengthForInterleavedBlock(int32_t index) const; + int32_t getErrorLengthForInterleavedBlock(int32_t index) const; - private: - CBC_SymbolInfo(bool rectangular, - int32_t dataCapacity, + int32_t dataCapacity() const { return m_dataCapacity; } + int32_t errorCodewords() const { return m_errorCodewords; } + int32_t matrixWidth() const { return m_matrixWidth; } + int32_t matrixHeight() const { return m_matrixHeight; } + + protected: + CBC_SymbolInfo(int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, @@ -64,8 +59,18 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { int32_t rsBlockData, int32_t rsBlockError); - bool m_rectangular; - int32_t m_dataRegions; + private: + int32_t getHorizontalDataRegions() const; + int32_t getVerticalDataRegions() const; + + const bool m_rectangular; + const int32_t m_dataCapacity; + const int32_t m_errorCodewords; + const int32_t m_matrixWidth; + const int32_t m_matrixHeight; + const int32_t m_dataRegions; + const int32_t m_rsBlockData; + const int32_t m_rsBlockError; }; #endif // FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_ |