From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: 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 Commit-Queue: Ryan Harrison --- fxbarcode/datamatrix/BC_EdifactEncoder.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fxbarcode/datamatrix/BC_EdifactEncoder.cpp') 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((v >> 16) & 255); cw[1] = static_cast((v >> 8) & 255); cw[2] = static_cast(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; -- cgit v1.2.3