diff options
Diffstat (limited to 'fxbarcode/qrcode')
-rw-r--r-- | fxbarcode/qrcode/BC_QRCodeWriter.cpp | 2 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCodeWriter.h | 2 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderEncoder.cpp | 29 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderEncoder.h | 2 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h | 4 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderMode.cpp | 4 | ||||
-rw-r--r-- | fxbarcode/qrcode/BC_QRCoderMode.h | 6 |
7 files changed, 24 insertions, 25 deletions
diff --git a/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/fxbarcode/qrcode/BC_QRCodeWriter.cpp index c679e9fca6..eb35af3867 100644 --- a/fxbarcode/qrcode/BC_QRCodeWriter.cpp +++ b/fxbarcode/qrcode/BC_QRCodeWriter.cpp @@ -55,7 +55,7 @@ bool CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) { return true; } -uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents, +uint8_t* CBC_QRCodeWriter::Encode(const WideString& contents, int32_t ecLevel, int32_t& outWidth, int32_t& outHeight) { diff --git a/fxbarcode/qrcode/BC_QRCodeWriter.h b/fxbarcode/qrcode/BC_QRCodeWriter.h index 1a0502d72e..3b3efc90ca 100644 --- a/fxbarcode/qrcode/BC_QRCodeWriter.h +++ b/fxbarcode/qrcode/BC_QRCodeWriter.h @@ -17,7 +17,7 @@ class CBC_QRCodeWriter : public CBC_TwoDimWriter { static void ReleaseAll(); - uint8_t* Encode(const CFX_WideString& contents, + uint8_t* Encode(const WideString& contents, int32_t ecLevel, int32_t& outWidth, int32_t& outHeight); 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; diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.h b/fxbarcode/qrcode/BC_QRCoderEncoder.h index 6bba889bd4..3acbd1bde8 100644 --- a/fxbarcode/qrcode/BC_QRCoderEncoder.h +++ b/fxbarcode/qrcode/BC_QRCoderEncoder.h @@ -20,7 +20,7 @@ class CBC_QRCoderEncoder { CBC_QRCoderEncoder(); ~CBC_QRCoderEncoder(); - static bool Encode(const CFX_WideString& content, + static bool Encode(const WideString& content, const CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder* qrCode); }; diff --git a/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h b/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h index e153c64395..ff7563ccfe 100644 --- a/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h +++ b/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h @@ -25,7 +25,7 @@ class CBC_QRCoderErrorCorrectionLevel { int32_t Ordinal() const { return m_ordinal; } int32_t GetBits() const { return m_bits; } - CFX_ByteString GetName() const { return m_name; } + ByteString GetName() const { return m_name; } private: CBC_QRCoderErrorCorrectionLevel(int32_t ordinal, @@ -35,7 +35,7 @@ class CBC_QRCoderErrorCorrectionLevel { int32_t m_ordinal; int32_t m_bits; - CFX_ByteString m_name; + ByteString m_name; }; #endif // FXBARCODE_QRCODE_BC_QRCODERERRORCORRECTIONLEVEL_H_ diff --git a/fxbarcode/qrcode/BC_QRCoderMode.cpp b/fxbarcode/qrcode/BC_QRCoderMode.cpp index 5f9ce5bf25..0f8c227843 100644 --- a/fxbarcode/qrcode/BC_QRCoderMode.cpp +++ b/fxbarcode/qrcode/BC_QRCoderMode.cpp @@ -39,7 +39,7 @@ CBC_QRCoderMode* CBC_QRCoderMode::sSTRUCTURED_APPEND = nullptr; CBC_QRCoderMode::CBC_QRCoderMode(std::vector<int32_t> charCountBits, int32_t bits, - CFX_ByteString name) + ByteString name) : m_characterCountBitsForVersions(std::move(charCountBits)), m_bits(bits), m_name(name) {} @@ -107,7 +107,7 @@ int32_t CBC_QRCoderMode::GetBits() const { return m_bits; } -CFX_ByteString CBC_QRCoderMode::GetName() const { +ByteString CBC_QRCoderMode::GetName() const { return m_name; } diff --git a/fxbarcode/qrcode/BC_QRCoderMode.h b/fxbarcode/qrcode/BC_QRCoderMode.h index 6669cbfbc9..9f2844da97 100644 --- a/fxbarcode/qrcode/BC_QRCoderMode.h +++ b/fxbarcode/qrcode/BC_QRCoderMode.h @@ -24,7 +24,7 @@ class CBC_QRCoderMode { int32_t GetCharacterCountBits(int32_t number, int32_t& e) const; int32_t GetBits() const; - CFX_ByteString GetName() const; + ByteString GetName() const; static CBC_QRCoderMode* sBYTE; static CBC_QRCoderMode* sNUMERIC; @@ -41,11 +41,11 @@ class CBC_QRCoderMode { CBC_QRCoderMode(); CBC_QRCoderMode(std::vector<int32_t> charCountBits, int32_t bits, - CFX_ByteString name); + ByteString name); std::vector<int32_t> m_characterCountBitsForVersions; const int32_t m_bits; - const CFX_ByteString m_name; + const ByteString m_name; }; #endif // FXBARCODE_QRCODE_BC_QRCODERMODE_H_ |