Home | History | Annotate | Download | only in qrcode
      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 _BC_QRDECODEDBITSTREAMPARSER_H_
      8 #define _BC_QRDECODEDBITSTREAMPARSER_H_
      9 class CBC_CommonDecoderResult;
     10 class CBC_QRCoderErrorCorrectionLevel;
     11 class CBC_CommonBitSource;
     12 class CBC_QRCoderVersion;
     13 class CBC_CommonCharacterSetECI;
     14 class CBC_QRDecodedBitStreamParser {
     15  private:
     16   const static FX_CHAR ALPHANUMERIC_CHARS[45];
     17   static const FX_CHAR* UTF_8;
     18   CBC_QRDecodedBitStreamParser();
     19 
     20  public:
     21   virtual ~CBC_QRDecodedBitStreamParser();
     22   static CBC_CommonDecoderResult* Decode(
     23       CFX_ByteArray* bytes,
     24       CBC_QRCoderVersion* version,
     25       CBC_QRCoderErrorCorrectionLevel* ecLevel,
     26       int32_t byteModeDecode,
     27       int32_t& e);
     28 
     29   static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes);
     30   static int32_t ParseECIValue(CBC_CommonBitSource* bits, int32_t& e);
     31   static void DecodeGBKSegment(CBC_CommonBitSource* bits,
     32                                CFX_ByteString& result,
     33                                int32_t count,
     34                                int32_t& e);
     35   static void DecodeKanjiSegment(CBC_CommonBitSource* bits,
     36                                  CFX_ByteString& result,
     37                                  int32_t count,
     38                                  int32_t& e);
     39   static void DecodeNumericSegment(CBC_CommonBitSource* bits,
     40                                    CFX_ByteString& result,
     41                                    int32_t count,
     42                                    int32_t& e);
     43   static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits,
     44                                         CFX_ByteString& result,
     45                                         int32_t count,
     46                                         FX_BOOL fac1InEffect,
     47                                         int32_t& e);
     48   static void DecodeByteSegment(
     49       CBC_CommonBitSource* bits,
     50       CFX_ByteString& result,
     51       int32_t count,
     52       CBC_CommonCharacterSetECI* currentCharacterSetECI,
     53       CFX_Int32Array* byteSegments,
     54       int32_t byteModeDecode,
     55       int32_t& e);
     56 };
     57 #endif
     58