OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef _BC_QRDECODEDBITSTREAMPARSER_H_ | 7 #ifndef _BC_QRDECODEDBITSTREAMPARSER_H_ |
8 #define _BC_QRDECODEDBITSTREAMPARSER_H_ | 8 #define _BC_QRDECODEDBITSTREAMPARSER_H_ |
9 class CBC_CommonDecoderResult; | 9 class CBC_CommonDecoderResult; |
10 class CBC_QRCoderErrorCorrectionLevel; | 10 class CBC_QRCoderErrorCorrectionLevel; |
11 class CBC_CommonBitSource; | 11 class CBC_CommonBitSource; |
12 class CBC_QRCoderVersion; | 12 class CBC_QRCoderVersion; |
13 class CBC_CommonCharacterSetECI; | 13 class CBC_CommonCharacterSetECI; |
14 class CBC_QRDecodedBitStreamParser; | 14 class CBC_QRDecodedBitStreamParser |
15 class CBC_QRDecodedBitStreamParser : public CFX_Object | |
16 { | 15 { |
17 private: | 16 private: |
18 const static FX_CHAR ALPHANUMERIC_CHARS[45]; | 17 const static FX_CHAR ALPHANUMERIC_CHARS[45]; |
19 static FX_LPCSTR UTF_8; | 18 static FX_LPCSTR UTF_8; |
20 CBC_QRDecodedBitStreamParser(); | 19 CBC_QRDecodedBitStreamParser(); |
21 public: | 20 public: |
22 virtual ~CBC_QRDecodedBitStreamParser(); | 21 virtual ~CBC_QRDecodedBitStreamParser(); |
23 static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVers
ion *version, | 22 static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVers
ion *version, |
24 CBC_QRCoderErrorCorrectionLevel* ecLe
vel, FX_INT32 byteModeDecode, FX_INT32 &e); | 23 CBC_QRCoderErrorCorrectionLevel* ecLe
vel, FX_INT32 byteModeDecode, FX_INT32 &e); |
25 | 24 |
26 static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes); | 25 static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes); |
27 static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e); | 26 static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e); |
28 static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &resu
lt, FX_INT32 count, FX_INT32 &e); | 27 static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &resu
lt, FX_INT32 count, FX_INT32 &e); |
29 static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &re
sult, FX_INT32 count, FX_INT32 &e); | 28 static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &re
sult, FX_INT32 count, FX_INT32 &e); |
30 static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &
result, FX_INT32 count, FX_INT32 &e); | 29 static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &
result, FX_INT32 count, FX_INT32 &e); |
31 static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteStr
ing &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e); | 30 static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteStr
ing &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e); |
32 static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &res
ult, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI, | 31 static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &res
ult, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI, |
33 CFX_Int32Array *byteSegments, FX_INT32 byteMod
eDecode, FX_INT32 &e); | 32 CFX_Int32Array *byteSegments, FX_INT32 byteMod
eDecode, FX_INT32 &e); |
34 }; | 33 }; |
35 #endif | 34 #endif |
OLD | NEW |