summaryrefslogtreecommitdiff
path: root/fxbarcode/qrcode/BC_QRCoderEncoder.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/qrcode/BC_QRCoderEncoder.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/qrcode/BC_QRCoderEncoder.cpp')
-rw-r--r--fxbarcode/qrcode/BC_QRCoderEncoder.cpp29
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;