summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
committerNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
commit9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch)
treec97037f398d714665aefccb6eb54d0969ad7030c /xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h
parent780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff)
downloadpdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz
XFA: clang-format all pdfium code.
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
Diffstat (limited to 'xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h149
1 files changed, 109 insertions, 40 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h
index 303dbcb767..26022f59e6 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h
@@ -14,47 +14,116 @@ class CBC_QRCoderBitVector;
class CBC_CommonByteArray;
class CBC_CommonByteMatrix;
class CBC_QRCoderEncoder;
-class CBC_QRCoderEncoder
-{
-private:
- const static int32_t m_alphaNumbericTable[96];
-public:
- CBC_QRCoderEncoder();
- virtual ~CBC_QRCoderEncoder();
+class CBC_QRCoderEncoder {
+ private:
+ const static int32_t m_alphaNumbericTable[96];
- static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e, int32_t versionSpecify = 0);
- static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e);
- static void EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- CBC_QRCoder *qrCode, int32_t versionSpecify, int32_t &e);
- static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, int32_t &e);
- static CBC_QRCoderMode* ChooseMode(const CFX_ByteString & content, CFX_ByteString encoding);
- static int32_t GetAlphaNumericCode(int32_t code);
- static void AppendECI(CBC_QRCoderBitVector* bits);
- static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e);
- static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
- static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
- static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, int32_t &e);
- static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, int32_t &e);
- static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
- static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, int32_t &e);
- static void InitQRCode(int32_t numInputBytes, int32_t versionNumber,
- CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e);
- static void InitQRCode(int32_t numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, int32_t &e);
- static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e);
- static void AppendLengthInfo(int32_t numLetters, int32_t version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, int32_t &e);
+ public:
+ CBC_QRCoderEncoder();
+ virtual ~CBC_QRCoderEncoder();
- static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, int32_t numTotalBytes, int32_t numDataBytes, int32_t numRSBlocks, CBC_QRCoderBitVector* result, int32_t &e);
- static void GetNumDataBytesAndNumECBytesForBlockID(int32_t numTotalBytes, int32_t numDataBytes,
- int32_t numRSBlocks, int32_t blockID,
- int32_t &numDataBytesInBlock, int32_t& numECBytesInBlocks);
- static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, int32_t numEcBytesInBlock, int32_t &e);
- static int32_t ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
- int32_t version, CBC_CommonByteMatrix* matrix, int32_t &e);
- static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix);
- static void TerminateBits(int32_t numDataBytes, CBC_QRCoderBitVector* bits, int32_t &e);
- static int32_t GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, int32_t versionNum, int32_t &e);
- static void MergeString(CFX_PtrArray &result, int32_t versionNum, int32_t &e);
- static void SplitString(const CFX_ByteString &content, CFX_PtrArray &result);
- static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, int32_t &e);
+ static void Encode(const CFX_ByteString& content,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoder* qrCode,
+ int32_t& e,
+ int32_t versionSpecify = 0);
+ static void Encode(const CFX_WideString& content,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoder* qrCode,
+ int32_t& e);
+ static void EncodeWithSpecifyVersion(const CFX_ByteString& content,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoder* qrCode,
+ int32_t versionSpecify,
+ int32_t& e);
+ static void EncodeWithAutoVersion(const CFX_ByteString& content,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoder* qrCode,
+ int32_t& e);
+ static CBC_QRCoderMode* ChooseMode(const CFX_ByteString& content,
+ CFX_ByteString encoding);
+ static int32_t GetAlphaNumericCode(int32_t code);
+ static void AppendECI(CBC_QRCoderBitVector* bits);
+ static void AppendBytes(const CFX_ByteString& content,
+ CBC_QRCoderMode* mode,
+ CBC_QRCoderBitVector* bits,
+ CFX_ByteString encoding,
+ int32_t& e);
+ static void AppendNumericBytes(const CFX_ByteString& content,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void AppendAlphaNumericBytes(const CFX_ByteString& content,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void Append8BitBytes(const CFX_ByteString& content,
+ CBC_QRCoderBitVector* bits,
+ CFX_ByteString encoding,
+ int32_t& e);
+ static void Append8BitBytes(CFX_ByteArray& bytes,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void AppendKanjiBytes(const CFX_ByteString& content,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void AppendGBKBytes(const CFX_ByteString& content,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void InitQRCode(int32_t numInputBytes,
+ int32_t versionNumber,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoderMode* mode,
+ CBC_QRCoder* qrCode,
+ int32_t& e);
+ static void InitQRCode(int32_t numInputBytes,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoderMode* mode,
+ CBC_QRCoder* qrCode,
+ int32_t& e);
+ static void AppendModeInfo(CBC_QRCoderMode* mode,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static void AppendLengthInfo(int32_t numLetters,
+ int32_t version,
+ CBC_QRCoderMode* mode,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+
+ static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits,
+ int32_t numTotalBytes,
+ int32_t numDataBytes,
+ int32_t numRSBlocks,
+ CBC_QRCoderBitVector* result,
+ int32_t& e);
+ static void GetNumDataBytesAndNumECBytesForBlockID(
+ int32_t numTotalBytes,
+ int32_t numDataBytes,
+ int32_t numRSBlocks,
+ int32_t blockID,
+ int32_t& numDataBytesInBlock,
+ int32_t& numECBytesInBlocks);
+ static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes,
+ int32_t numEcBytesInBlock,
+ int32_t& e);
+ static int32_t ChooseMaskPattern(CBC_QRCoderBitVector* bits,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ int32_t version,
+ CBC_CommonByteMatrix* matrix,
+ int32_t& e);
+ static int32_t CalculateMaskPenalty(CBC_CommonByteMatrix* matrix);
+ static void TerminateBits(int32_t numDataBytes,
+ CBC_QRCoderBitVector* bits,
+ int32_t& e);
+ static int32_t GetSpanByVersion(CBC_QRCoderMode* modeFirst,
+ CBC_QRCoderMode* modeSecond,
+ int32_t versionNum,
+ int32_t& e);
+ static void MergeString(CFX_PtrArray& result, int32_t versionNum, int32_t& e);
+ static void SplitString(const CFX_ByteString& content, CFX_PtrArray& result);
+ static void AppendDataModeLenghInfo(CFX_PtrArray& splitResult,
+ CBC_QRCoderBitVector& headerAndDataBits,
+ CBC_QRCoderMode* tempMode,
+ CBC_QRCoder* qrCode,
+ CFX_ByteString& encoding,
+ int32_t& e);
};
#endif