diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fxbarcode/datamatrix/BC_EdifactEncoder.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-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/datamatrix/BC_EdifactEncoder.cpp')
-rw-r--r-- | fxbarcode/datamatrix/BC_EdifactEncoder.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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; |