diff options
Diffstat (limited to 'fxbarcode/qrcode/BC_QRCoderEncoder.cpp')
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderEncoder.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 4c488418d9..e1a4917792 100644 --- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -41,7 +41,7 @@ #include "fxbarcode/qrcode/BC_QRCoderVersion.h" #include "third_party/base/ptr_util.h" -using ModeStringPair = std::pair<CBC_QRCoderMode*, CFX_ByteString>; +using ModeStringPair = std::pair<CBC_QRCoderMode*, ByteString>; namespace { @@ -61,7 +61,7 @@ int32_t GetAlphaNumericCode(int32_t code) { return g_alphaNumericTable[code_index]; } -void AppendNumericBytes(const CFX_ByteString& content, +void AppendNumericBytes(const ByteString& content, CBC_QRCoderBitVector* bits, int32_t& e) { int32_t length = content.GetLength(); @@ -84,7 +84,7 @@ void AppendNumericBytes(const CFX_ByteString& content, } } -void AppendAlphaNumericBytes(const CFX_ByteString& content, +void AppendAlphaNumericBytes(const ByteString& content, CBC_QRCoderBitVector* bits, int32_t& e) { int32_t length = content.GetLength(); @@ -110,7 +110,7 @@ void AppendAlphaNumericBytes(const CFX_ByteString& content, } } -void AppendGBKBytes(const CFX_ByteString& content, +void AppendGBKBytes(const ByteString& content, CBC_QRCoderBitVector* bits, int32_t& e) { int32_t length = content.GetLength(); @@ -130,15 +130,15 @@ void AppendGBKBytes(const CFX_ByteString& content, } } -void Append8BitBytes(const CFX_ByteString& content, +void Append8BitBytes(const ByteString& content, CBC_QRCoderBitVector* bits, - CFX_ByteString encoding, + ByteString encoding, int32_t& e) { for (FX_STRSIZE i = 0; i < content.GetLength(); i++) bits->AppendBits(content[i], 8); } -void AppendKanjiBytes(const CFX_ByteString& content, +void AppendKanjiBytes(const ByteString& content, CBC_QRCoderBitVector* bits, int32_t& e) { std::vector<uint8_t> bytes; @@ -184,10 +184,10 @@ bool AppendLengthInfo(int32_t numLetters, return true; } -void AppendBytes(const CFX_ByteString& content, +void AppendBytes(const ByteString& content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, - CFX_ByteString encoding, + ByteString encoding, int32_t& e) { if (mode == CBC_QRCoderMode::sNUMERIC) AppendNumericBytes(content, bits, e); @@ -423,7 +423,7 @@ void MergeString(std::vector<ModeStringPair>* result, MergeString(result, versionNum, e); } -void SplitString(const CFX_ByteString& content, +void SplitString(const ByteString& content, std::vector<ModeStringPair>* result) { FX_STRSIZE index = 0; while (index < content.GetLength()) { @@ -484,8 +484,7 @@ void SplitString(const CFX_ByteString& content, SplitString(content.Right(content.GetLength() - index), result); } -CBC_QRCoderMode* ChooseMode(const CFX_ByteString& content, - CFX_ByteString encoding) { +CBC_QRCoderMode* ChooseMode(const ByteString& content, ByteString encoding) { if (encoding.Compare("SHIFT_JIS") == 0) return CBC_QRCoderMode::sKANJI; @@ -566,11 +565,11 @@ CBC_QRCoderEncoder::CBC_QRCoderEncoder() {} CBC_QRCoderEncoder::~CBC_QRCoderEncoder() {} // static -bool CBC_QRCoderEncoder::Encode(const CFX_WideString& content, +bool CBC_QRCoderEncoder::Encode(const WideString& content, const CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder* qrCode) { - CFX_ByteString encoding = "utf8"; - CFX_ByteString utf8Data; + ByteString encoding = "utf8"; + ByteString utf8Data; CBC_UtilCodingConvert::UnicodeToUTF8(content, utf8Data); CBC_QRCoderMode* mode = ChooseMode(utf8Data, encoding); CBC_QRCoderBitVector dataBits; |