summaryrefslogtreecommitdiff
path: root/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz
Convert string class names
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp')
-rw-r--r--fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index c531716e4f..1450b37ea9 100644
--- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -55,24 +55,23 @@ void CBC_PDF417HighLevelEncoder::Initialize() {
void CBC_PDF417HighLevelEncoder::Finalize() {}
-CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
- CFX_WideString wideMsg,
- Compaction compaction,
- int32_t& e) {
- CFX_ByteString bytes;
+WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(WideString wideMsg,
+ Compaction compaction,
+ int32_t& e) {
+ ByteString bytes;
CBC_UtilCodingConvert::UnicodeToUTF8(wideMsg, bytes);
- CFX_WideString msg;
+ WideString msg;
int32_t len = bytes.GetLength();
for (int32_t i = 0; i < len; i++) {
wchar_t ch = (wchar_t)(bytes[i] & 0xff);
if (ch == '?' && bytes[i] != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
- return CFX_WideString();
+ return WideString();
}
msg += ch;
}
std::vector<uint8_t> byteArr(bytes.begin(), bytes.end());
- CFX_WideString sb;
+ WideString sb;
len = msg.GetLength();
int32_t p = 0;
int32_t textSubMode = SUBMODE_ALPHA;
@@ -145,12 +144,12 @@ void CBC_PDF417HighLevelEncoder::Inverse() {
}
}
-int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
+int32_t CBC_PDF417HighLevelEncoder::encodeText(WideString msg,
int32_t startpos,
int32_t count,
- CFX_WideString& sb,
+ WideString& sb,
int32_t initialSubmode) {
- CFX_WideString tmp;
+ WideString tmp;
int32_t submode = initialSubmode;
int32_t idx = 0;
while (true) {
@@ -262,7 +261,7 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(std::vector<uint8_t>* bytes,
int32_t startpos,
int32_t count,
int32_t startmode,
- CFX_WideString& sb) {
+ WideString& sb) {
if (count == 1 && startmode == TEXT_COMPACTION) {
sb += (wchar_t)SHIFT_TO_BYTE;
}
@@ -295,16 +294,16 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(std::vector<uint8_t>* bytes,
sb += (wchar_t)ch;
}
}
-void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg,
+void CBC_PDF417HighLevelEncoder::encodeNumeric(WideString msg,
int32_t startpos,
int32_t count,
- CFX_WideString& sb) {
+ WideString& sb) {
int32_t idx = 0;
BigInteger num900 = 900;
while (idx < count) {
- CFX_WideString tmp;
+ WideString tmp;
int32_t len = 44 < count - idx ? 44 : count - idx;
- CFX_ByteString part =
+ ByteString part =
((wchar_t)'1' + msg.Mid(startpos + idx, len)).UTF8Encode();
BigInteger bigint = stringToBigInteger(part.c_str());
do {
@@ -337,7 +336,7 @@ bool CBC_PDF417HighLevelEncoder::isText(wchar_t ch) {
return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126);
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(
- CFX_WideString msg,
+ WideString msg,
int32_t startpos) {
int32_t count = 0;
int32_t len = msg.GetLength();
@@ -355,7 +354,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(
return count;
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(
- CFX_WideString msg,
+ WideString msg,
int32_t startpos) {
int32_t len = msg.GetLength();
int32_t idx = startpos;
@@ -384,7 +383,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(
return idx - startpos;
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(
- CFX_WideString msg,
+ WideString msg,
std::vector<uint8_t>* bytes,
int32_t startpos,
int32_t& e) {