diff options
Diffstat (limited to 'fxbarcode/datamatrix')
-rw-r--r-- | fxbarcode/datamatrix/BC_Base256Encoder.cpp | 2 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_C40Encoder.cpp | 16 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_C40Encoder.h | 12 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_DataMatrixWriter.cpp | 8 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_DataMatrixWriter.h | 2 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_DefaultPlacement.cpp | 2 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_DefaultPlacement.h | 6 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_EdifactEncoder.cpp | 16 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_EncoderContext.cpp | 10 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_EncoderContext.h | 12 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 41 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_ErrorCorrection.h | 24 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 21 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_HighLevelEncoder.h | 16 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_TextEncoder.cpp | 2 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_TextEncoder.h | 2 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_X12Encoder.cpp | 6 | ||||
-rw-r--r-- | fxbarcode/datamatrix/BC_X12Encoder.h | 4 |
18 files changed, 98 insertions, 104 deletions
diff --git a/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/fxbarcode/datamatrix/BC_Base256Encoder.cpp index 0cbd3fdb10..b7dd69c0f7 100644 --- a/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -34,7 +34,7 @@ int32_t CBC_Base256Encoder::getEncodingMode() { return BASE256_ENCODATION; } void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { - CFX_WideString buffer; + WideString buffer; buffer += L'\0'; while (context.hasMoreCharacters()) { wchar_t c = context.getCurrentChar(); diff --git a/fxbarcode/datamatrix/BC_C40Encoder.cpp b/fxbarcode/datamatrix/BC_C40Encoder.cpp index 8a55c922ed..348315e149 100644 --- a/fxbarcode/datamatrix/BC_C40Encoder.cpp +++ b/fxbarcode/datamatrix/BC_C40Encoder.cpp @@ -31,7 +31,7 @@ namespace { -CFX_WideString EncodeToCodewords(const CFX_WideString& sb, int32_t startPos) { +WideString EncodeToCodewords(const WideString& sb, int32_t startPos) { wchar_t c1 = sb[startPos]; wchar_t c2 = sb[startPos + 1]; wchar_t c3 = sb[startPos + 2]; @@ -39,7 +39,7 @@ CFX_WideString EncodeToCodewords(const CFX_WideString& sb, int32_t startPos) { wchar_t cw[2]; cw[0] = static_cast<wchar_t>(v / 256); cw[1] = static_cast<wchar_t>(v % 256); - return CFX_WideString(cw, FX_ArraySize(cw)); + return WideString(cw, FX_ArraySize(cw)); } } // namespace @@ -50,7 +50,7 @@ int32_t CBC_C40Encoder::getEncodingMode() { return C40_ENCODATION; } void CBC_C40Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { - CFX_WideString buffer; + WideString buffer; while (context.hasMoreCharacters()) { wchar_t c = context.getCurrentChar(); context.m_pos++; @@ -98,12 +98,12 @@ void CBC_C40Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { handleEOD(context, buffer, e); } void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext& context, - CFX_WideString& buffer) { + WideString& buffer) { context.writeCodewords(EncodeToCodewords(buffer, 0)); buffer.Delete(0, 3); } void CBC_C40Encoder::handleEOD(CBC_EncoderContext& context, - CFX_WideString& buffer, + WideString& buffer, int32_t& e) { int32_t unwritten = (buffer.GetLength() / 3) * 2; int32_t rest = buffer.GetLength() % 3; @@ -142,7 +142,7 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext& context, } context.signalEncoderChange(ASCII_ENCODATION); } -int32_t CBC_C40Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) { +int32_t CBC_C40Encoder::encodeChar(wchar_t c, WideString& sb, int32_t& e) { if (c == ' ') { sb += (wchar_t)'\3'; return 1; @@ -187,7 +187,7 @@ int32_t CBC_C40Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) { } int32_t CBC_C40Encoder::BacktrackOneCharacter(CBC_EncoderContext* context, - CFX_WideString* buffer, + WideString* buffer, int32_t lastCharSize) { if (context->m_pos < 1) return -1; @@ -200,7 +200,7 @@ int32_t CBC_C40Encoder::BacktrackOneCharacter(CBC_EncoderContext* context, context->m_pos--; wchar_t c = context->getCurrentChar(); int32_t e = BCExceptionNO; - CFX_WideString removed; + WideString removed; int32_t len = encodeChar(c, removed, e); if (e != BCExceptionNO) return -1; diff --git a/fxbarcode/datamatrix/BC_C40Encoder.h b/fxbarcode/datamatrix/BC_C40Encoder.h index 550d226efb..5ddad92009 100644 --- a/fxbarcode/datamatrix/BC_C40Encoder.h +++ b/fxbarcode/datamatrix/BC_C40Encoder.h @@ -7,10 +7,9 @@ #ifndef FXBARCODE_DATAMATRIX_BC_C40ENCODER_H_ #define FXBARCODE_DATAMATRIX_BC_C40ENCODER_H_ +#include "core/fxcrt/widestring.h" #include "fxbarcode/datamatrix/BC_Encoder.h" -class CFX_WideString; - class CBC_C40Encoder : public CBC_Encoder { public: CBC_C40Encoder(); @@ -20,13 +19,12 @@ class CBC_C40Encoder : public CBC_Encoder { int32_t getEncodingMode() override; void Encode(CBC_EncoderContext& context, int32_t& e) override; - static void writeNextTriplet(CBC_EncoderContext& context, - CFX_WideString& buffer); + static void writeNextTriplet(CBC_EncoderContext& context, WideString& buffer); virtual void handleEOD(CBC_EncoderContext& context, - CFX_WideString& buffer, + WideString& buffer, int32_t& e); - virtual int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e); + virtual int32_t encodeChar(wchar_t c, WideString& sb, int32_t& e); private: // Moves back by 1 position in |context| and adjusts |buffer| accordingly @@ -34,7 +32,7 @@ class CBC_C40Encoder : public CBC_Encoder { // |context| after adjusting the position. If the character cannot be encoded, // return -1. int32_t BacktrackOneCharacter(CBC_EncoderContext* context, - CFX_WideString* buffer, + WideString* buffer, int32_t lastCharSize); }; diff --git a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 98af282f8f..d4f9ad3479 100644 --- a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -108,15 +108,15 @@ bool CBC_DataMatrixWriter::SetErrorCorrectionLevel(int32_t level) { return true; } -uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents, +uint8_t* CBC_DataMatrixWriter::Encode(const WideString& contents, int32_t& outWidth, int32_t& outHeight) { if (outWidth < 0 || outHeight < 0) return nullptr; - CFX_WideString ecLevel; + WideString ecLevel; int32_t e = BCExceptionNO; - CFX_WideString encoded = + WideString encoded = CBC_HighLevelEncoder::encodeHighLevel(contents, ecLevel, false, e); if (e != BCExceptionNO) return nullptr; @@ -124,7 +124,7 @@ uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString& contents, CBC_SymbolInfo::lookup(encoded.GetLength(), false, e); if (e != BCExceptionNO) return nullptr; - CFX_WideString codewords = + WideString codewords = CBC_ErrorCorrection::encodeECC200(encoded, symbolInfo, e); if (e != BCExceptionNO) return nullptr; diff --git a/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/fxbarcode/datamatrix/BC_DataMatrixWriter.h index 84b83fe7a3..ba2c54762e 100644 --- a/fxbarcode/datamatrix/BC_DataMatrixWriter.h +++ b/fxbarcode/datamatrix/BC_DataMatrixWriter.h @@ -18,7 +18,7 @@ class CBC_DataMatrixWriter : public CBC_TwoDimWriter { CBC_DataMatrixWriter(); ~CBC_DataMatrixWriter() override; - uint8_t* Encode(const CFX_WideString& contents, + uint8_t* Encode(const WideString& contents, int32_t& outWidth, int32_t& outHeight); diff --git a/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/fxbarcode/datamatrix/BC_DefaultPlacement.cpp index 934d79503c..3f1b35864f 100644 --- a/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/fxbarcode/datamatrix/BC_DefaultPlacement.cpp @@ -23,7 +23,7 @@ #include "fxbarcode/datamatrix/BC_DefaultPlacement.h" #include "fxbarcode/datamatrix/BC_Encoder.h" -CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, +CBC_DefaultPlacement::CBC_DefaultPlacement(WideString codewords, int32_t numcols, int32_t numrows) { m_codewords = codewords; diff --git a/fxbarcode/datamatrix/BC_DefaultPlacement.h b/fxbarcode/datamatrix/BC_DefaultPlacement.h index 17ecac9f5c..12ea852136 100644 --- a/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/fxbarcode/datamatrix/BC_DefaultPlacement.h @@ -13,9 +13,7 @@ class CBC_DefaultPlacement { public: - CBC_DefaultPlacement(CFX_WideString codewords, - int32_t numcols, - int32_t numrows); + CBC_DefaultPlacement(WideString codewords, int32_t numcols, int32_t numrows); virtual ~CBC_DefaultPlacement(); int32_t getNumrows(); @@ -27,7 +25,7 @@ class CBC_DefaultPlacement { void place(); private: - CFX_WideString m_codewords; + WideString m_codewords; int32_t m_numrows; int32_t m_numcols; std::vector<uint8_t> m_bits; diff --git a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp index 7407efb47e..438c87a38f 100644 --- a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp +++ b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp @@ -33,10 +33,10 @@ namespace { -CFX_WideString EncodeToCodewords(const CFX_WideString& sb, int32_t startPos) { +WideString EncodeToCodewords(const WideString& sb, int32_t startPos) { int32_t len = sb.GetLength() - startPos; if (len == 0) - return CFX_WideString(); + return WideString(); wchar_t c1 = sb[startPos]; wchar_t c2 = len >= 2 ? sb[startPos + 1] : 0; @@ -48,10 +48,10 @@ CFX_WideString EncodeToCodewords(const CFX_WideString& sb, int32_t startPos) { cw[0] = static_cast<wchar_t>((v >> 16) & 255); cw[1] = static_cast<wchar_t>((v >> 8) & 255); cw[2] = static_cast<wchar_t>(v & 255); - return CFX_WideString(cw, std::min(len, kBuflen)); + return WideString(cw, std::min(len, kBuflen)); } -bool HandleEOD(CBC_EncoderContext* context, const CFX_WideString& buffer) { +bool HandleEOD(CBC_EncoderContext* context, const WideString& buffer) { int32_t count = buffer.GetLength(); if (count == 0) return true; @@ -72,7 +72,7 @@ bool HandleEOD(CBC_EncoderContext* context, const CFX_WideString& buffer) { } int32_t restChars = count - 1; - CFX_WideString encoded = EncodeToCodewords(buffer, 0); + WideString encoded = EncodeToCodewords(buffer, 0); if (encoded.IsEmpty()) return false; @@ -105,7 +105,7 @@ bool HandleEOD(CBC_EncoderContext* context, const CFX_WideString& buffer) { return true; } -void encodeChar(wchar_t c, CFX_WideString* sb, int32_t& e) { +void encodeChar(wchar_t c, WideString* sb, int32_t& e) { if (c >= ' ' && c <= '?') { *sb += c; } else if (c >= '@' && c <= '^') { @@ -126,7 +126,7 @@ int32_t CBC_EdifactEncoder::getEncodingMode() { } void CBC_EdifactEncoder::Encode(CBC_EncoderContext& context, int32_t& e) { - CFX_WideString buffer; + WideString buffer; while (context.hasMoreCharacters()) { wchar_t c = context.getCurrentChar(); encodeChar(c, &buffer, e); @@ -136,7 +136,7 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext& context, int32_t& e) { context.m_pos++; int32_t count = buffer.GetLength(); if (count >= 4) { - CFX_WideString encoded = EncodeToCodewords(buffer, 0); + WideString encoded = EncodeToCodewords(buffer, 0); if (encoded.IsEmpty()) { e = BCExceptionGeneric; return; diff --git a/fxbarcode/datamatrix/BC_EncoderContext.cpp b/fxbarcode/datamatrix/BC_EncoderContext.cpp index eaf3768f49..6e1671035a 100644 --- a/fxbarcode/datamatrix/BC_EncoderContext.cpp +++ b/fxbarcode/datamatrix/BC_EncoderContext.cpp @@ -28,12 +28,12 @@ #include "fxbarcode/datamatrix/BC_SymbolInfo.h" #include "fxbarcode/utils.h" -CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString& msg, - const CFX_WideString& ecLevel, +CBC_EncoderContext::CBC_EncoderContext(const WideString& msg, + const WideString& ecLevel, int32_t& e) { - CFX_ByteString dststr; + ByteString dststr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, dststr); - CFX_WideString sb; + WideString sb; FX_STRSIZE c = dststr.GetLength(); for (FX_STRSIZE i = 0; i < c; i++) { wchar_t ch = static_cast<wchar_t>(dststr[i] & 0xff); @@ -66,7 +66,7 @@ wchar_t CBC_EncoderContext::getCurrent() { return m_msg[m_pos]; } -void CBC_EncoderContext::writeCodewords(const CFX_WideString& codewords) { +void CBC_EncoderContext::writeCodewords(const WideString& codewords) { m_codewords += codewords; } diff --git a/fxbarcode/datamatrix/BC_EncoderContext.h b/fxbarcode/datamatrix/BC_EncoderContext.h index ef4c38ebab..1289a45e68 100644 --- a/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/fxbarcode/datamatrix/BC_EncoderContext.h @@ -8,14 +8,14 @@ #define FXBARCODE_DATAMATRIX_BC_ENCODERCONTEXT_H_ #include "core/fxcrt/cfx_unowned_ptr.h" -#include "core/fxcrt/cfx_widestring.h" +#include "core/fxcrt/widestring.h" class CBC_SymbolInfo; class CBC_EncoderContext { public: - CBC_EncoderContext(const CFX_WideString& msg, - const CFX_WideString& ecLevel, + CBC_EncoderContext(const WideString& msg, + const WideString& ecLevel, int32_t& e); ~CBC_EncoderContext(); @@ -23,7 +23,7 @@ class CBC_EncoderContext { void setSkipAtEnd(int32_t count); wchar_t getCurrentChar(); wchar_t getCurrent(); - void writeCodewords(const CFX_WideString& codewords); + void writeCodewords(const WideString& codewords); void writeCodeword(wchar_t codeword); FX_STRSIZE getCodewordCount(); void signalEncoderChange(int32_t encoding); @@ -34,8 +34,8 @@ class CBC_EncoderContext { void updateSymbolInfo(int32_t len, int32_t& e); void resetSymbolInfo(); - CFX_WideString m_msg; - CFX_WideString m_codewords; + WideString m_msg; + WideString m_codewords; FX_STRSIZE m_pos; int32_t m_newEncoding; CFX_UnownedPtr<CBC_SymbolInfo> m_symbolInfo; diff --git a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index c45eadcf9a..35077ee628 100644 --- a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -119,22 +119,21 @@ void CBC_ErrorCorrection::Initialize() { void CBC_ErrorCorrection::Finalize() {} CBC_ErrorCorrection::CBC_ErrorCorrection() {} CBC_ErrorCorrection::~CBC_ErrorCorrection() {} -CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, - CBC_SymbolInfo* symbolInfo, - int32_t& e) { +WideString CBC_ErrorCorrection::encodeECC200(WideString codewords, + CBC_SymbolInfo* symbolInfo, + int32_t& e) { if (pdfium::base::checked_cast<int32_t>(codewords.GetLength()) != symbolInfo->dataCapacity()) { e = BCExceptionIllegalArgument; - return CFX_WideString(); + return WideString(); } - CFX_WideString sb; + WideString sb; sb += codewords; int32_t blockCount = symbolInfo->getInterleavedBlockCount(); if (blockCount == 1) { - CFX_WideString ecc = - createECCBlock(codewords, symbolInfo->errorCodewords(), e); + WideString ecc = createECCBlock(codewords, symbolInfo->errorCodewords(), e); if (e != BCExceptionNO) - return CFX_WideString(); + return WideString(); sb += ecc; } else { std::vector<int32_t> dataSizes(blockCount); @@ -149,13 +148,13 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, } } for (int32_t block = 0; block < blockCount; block++) { - CFX_WideString temp; + WideString temp; for (int32_t d = block; d < symbolInfo->dataCapacity(); d += blockCount) { temp += (wchar_t)codewords[d]; } - CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e); + WideString ecc = createECCBlock(temp, errorSizes[block], e); if (e != BCExceptionNO) - return CFX_WideString(); + return WideString(); int32_t pos = 0; for (int32_t l = block; l < errorSizes[block] * blockCount; l += blockCount) { @@ -165,16 +164,16 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, } return sb; } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, - int32_t numECWords, - int32_t& e) { +WideString CBC_ErrorCorrection::createECCBlock(WideString codewords, + int32_t numECWords, + int32_t& e) { return createECCBlock(codewords, 0, codewords.GetLength(), numECWords, e); } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, - int32_t start, - int32_t len, - int32_t numECWords, - int32_t& e) { +WideString CBC_ErrorCorrection::createECCBlock(WideString codewords, + int32_t start, + int32_t len, + int32_t numECWords, + int32_t& e) { static const size_t kFactorTableNum = sizeof(FACTOR_SETS) / sizeof(int32_t); size_t table = 0; while (table < kFactorTableNum && FACTOR_SETS[table] != numECWords) @@ -182,7 +181,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, if (table >= kFactorTableNum) { e = BCExceptionIllegalArgument; - return CFX_WideString(); + return WideString(); } uint16_t* ecc = FX_Alloc(uint16_t, numECWords); memset(ecc, 0, numECWords * sizeof(uint16_t)); @@ -202,7 +201,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, ecc[0] = 0; } } - CFX_WideString strecc; + WideString strecc; for (int32_t j = 0; j < numECWords; j++) { strecc += (wchar_t)ecc[numECWords - j - 1]; } diff --git a/fxbarcode/datamatrix/BC_ErrorCorrection.h b/fxbarcode/datamatrix/BC_ErrorCorrection.h index 97a2e48e2d..361b205ef4 100644 --- a/fxbarcode/datamatrix/BC_ErrorCorrection.h +++ b/fxbarcode/datamatrix/BC_ErrorCorrection.h @@ -7,7 +7,7 @@ #ifndef FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_ #define FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_ -#include "core/fxcrt/cfx_widestring.h" +#include "core/fxcrt/widestring.h" class CBC_SymbolInfo; @@ -18,9 +18,9 @@ class CBC_ErrorCorrection { static void Initialize(); static void Finalize(); - static CFX_WideString encodeECC200(CFX_WideString codewords, - CBC_SymbolInfo* symbolInfo, - int32_t& e); + static WideString encodeECC200(WideString codewords, + CBC_SymbolInfo* symbolInfo, + int32_t& e); private: static int32_t MODULO_VALUE; @@ -28,14 +28,14 @@ class CBC_ErrorCorrection { static int32_t ALOG[256]; private: - static CFX_WideString createECCBlock(CFX_WideString codewords, - int32_t numECWords, - int32_t& e); - static CFX_WideString createECCBlock(CFX_WideString codewords, - int32_t start, - int32_t len, - int32_t numECWords, - int32_t& e); + static WideString createECCBlock(WideString codewords, + int32_t numECWords, + int32_t& e); + static WideString createECCBlock(WideString codewords, + int32_t start, + int32_t len, + int32_t numECWords, + int32_t& e); }; #endif // FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_ diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index b8c63946db..56a8847066 100644 --- a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -58,22 +58,21 @@ const wchar_t CBC_HighLevelEncoder::MACRO_TRAILER = 0x0004; CBC_HighLevelEncoder::CBC_HighLevelEncoder() {} CBC_HighLevelEncoder::~CBC_HighLevelEncoder() {} -std::vector<uint8_t>& CBC_HighLevelEncoder::getBytesForMessage( - CFX_WideString msg) { - CFX_ByteString bytestr; +std::vector<uint8_t>& CBC_HighLevelEncoder::getBytesForMessage(WideString msg) { + ByteString bytestr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr); m_bytearray.insert(m_bytearray.end(), bytestr.begin(), bytestr.end()); return m_bytearray; } // static -CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, - CFX_WideString ecLevel, - bool allowRectangular, - int32_t& e) { +WideString CBC_HighLevelEncoder::encodeHighLevel(WideString msg, + WideString ecLevel, + bool allowRectangular, + int32_t& e) { CBC_EncoderContext context(msg, ecLevel, e); if (e != BCExceptionNO) - return CFX_WideString(); + return WideString(); context.setAllowRectangular(allowRectangular); if ((msg.Left(6) == MACRO_05_HEADER) && (msg.Last() == MACRO_TRAILER)) { @@ -117,7 +116,7 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, context.writeCodeword(0x00fe); } } - CFX_WideString codewords = context.m_codewords; + WideString codewords = context.m_codewords; if (pdfium::base::checked_cast<int32_t>(codewords.GetLength()) < capacity) { codewords += PAD; } @@ -128,7 +127,7 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, } return codewords; } -int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, +int32_t CBC_HighLevelEncoder::lookAheadTest(WideString msg, int32_t startpos, int32_t currentMode) { if (startpos >= pdfium::base::checked_cast<int32_t>(msg.GetLength())) { @@ -279,7 +278,7 @@ bool CBC_HighLevelEncoder::isDigit(wchar_t ch) { bool CBC_HighLevelEncoder::isExtendedASCII(wchar_t ch) { return ch >= 128 && ch <= 255; } -int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, +int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(WideString msg, int32_t startpos) { int32_t count = 0; int32_t len = msg.GetLength(); diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 0b7ff9bf0e..50cfc8c592 100644 --- a/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -9,7 +9,7 @@ #include <vector> -#include "core/fxcrt/cfx_widestring.h" +#include "core/fxcrt/widestring.h" #define ASCII_ENCODATION 0 #define C40_ENCODATION 1 @@ -23,18 +23,18 @@ class CBC_HighLevelEncoder { CBC_HighLevelEncoder(); ~CBC_HighLevelEncoder(); - std::vector<uint8_t>& getBytesForMessage(CFX_WideString msg); + std::vector<uint8_t>& getBytesForMessage(WideString msg); - static CFX_WideString encodeHighLevel(CFX_WideString msg, - CFX_WideString ecLevel, - bool allowRectangular, - int32_t& e); - static int32_t lookAheadTest(CFX_WideString msg, + static WideString encodeHighLevel(WideString msg, + WideString ecLevel, + bool allowRectangular, + int32_t& e); + static int32_t lookAheadTest(WideString msg, int32_t startpos, int32_t currentMode); static bool isDigit(wchar_t ch); static bool isExtendedASCII(wchar_t ch); - static int32_t determineConsecutiveDigitCount(CFX_WideString msg, + static int32_t determineConsecutiveDigitCount(WideString msg, int32_t startpos); static const wchar_t LATCH_TO_C40; diff --git a/fxbarcode/datamatrix/BC_TextEncoder.cpp b/fxbarcode/datamatrix/BC_TextEncoder.cpp index 451c7b84d1..a78310ed21 100644 --- a/fxbarcode/datamatrix/BC_TextEncoder.cpp +++ b/fxbarcode/datamatrix/BC_TextEncoder.cpp @@ -33,7 +33,7 @@ CBC_TextEncoder::~CBC_TextEncoder() {} int32_t CBC_TextEncoder::getEncodingMode() { return TEXT_ENCODATION; } -int32_t CBC_TextEncoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) { +int32_t CBC_TextEncoder::encodeChar(wchar_t c, WideString& sb, int32_t& e) { if (c == ' ') { sb += (wchar_t)'\3'; return 1; diff --git a/fxbarcode/datamatrix/BC_TextEncoder.h b/fxbarcode/datamatrix/BC_TextEncoder.h index c4ba3c3e09..9d4cdafe10 100644 --- a/fxbarcode/datamatrix/BC_TextEncoder.h +++ b/fxbarcode/datamatrix/BC_TextEncoder.h @@ -16,7 +16,7 @@ class CBC_TextEncoder : public CBC_C40Encoder { // CBC_C40Encoder int32_t getEncodingMode() override; - int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) override; + int32_t encodeChar(wchar_t c, WideString& sb, int32_t& e) override; }; #endif // FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_ diff --git a/fxbarcode/datamatrix/BC_X12Encoder.cpp b/fxbarcode/datamatrix/BC_X12Encoder.cpp index 625ff90290..a080a71eac 100644 --- a/fxbarcode/datamatrix/BC_X12Encoder.cpp +++ b/fxbarcode/datamatrix/BC_X12Encoder.cpp @@ -36,7 +36,7 @@ int32_t CBC_X12Encoder::getEncodingMode() { return X12_ENCODATION; } void CBC_X12Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { - CFX_WideString buffer; + WideString buffer; while (context.hasMoreCharacters()) { wchar_t c = context.getCurrentChar(); context.m_pos++; @@ -58,7 +58,7 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { handleEOD(context, buffer, e); } void CBC_X12Encoder::handleEOD(CBC_EncoderContext& context, - CFX_WideString& buffer, + WideString& buffer, int32_t& e) { context.updateSymbolInfo(e); if (e != BCExceptionNO) { @@ -79,7 +79,7 @@ void CBC_X12Encoder::handleEOD(CBC_EncoderContext& context, context.signalEncoderChange(ASCII_ENCODATION); } } -int32_t CBC_X12Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) { +int32_t CBC_X12Encoder::encodeChar(wchar_t c, WideString& sb, int32_t& e) { if (c == '\r') { sb += (wchar_t)'\0'; } else if (c == '*') { diff --git a/fxbarcode/datamatrix/BC_X12Encoder.h b/fxbarcode/datamatrix/BC_X12Encoder.h index 146f739f84..324b78bdcc 100644 --- a/fxbarcode/datamatrix/BC_X12Encoder.h +++ b/fxbarcode/datamatrix/BC_X12Encoder.h @@ -18,9 +18,9 @@ class CBC_X12Encoder : public CBC_C40Encoder { int32_t getEncodingMode() override; void Encode(CBC_EncoderContext& context, int32_t& e) override; void handleEOD(CBC_EncoderContext& context, - CFX_WideString& buffer, + WideString& buffer, int32_t& e) override; - int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) override; + int32_t encodeChar(wchar_t c, WideString& sb, int32_t& e) override; }; #endif // FXBARCODE_DATAMATRIX_BC_X12ENCODER_H_ |