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/oned/BC_OnedEAN8Writer.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/oned/BC_OnedEAN8Writer.cpp')
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN8Writer.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp index d4d438fe04..f92a1627b6 100644 --- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -63,13 +63,12 @@ bool CBC_OnedEAN8Writer::SetTextLocation(BC_TEXT_LOC location) { return false; } -bool CBC_OnedEAN8Writer::CheckContentValidity(const CFX_WideStringC& contents) { +bool CBC_OnedEAN8Writer::CheckContentValidity(const WideStringView& contents) { return std::all_of(contents.begin(), contents.end(), std::iswdigit); } -CFX_WideString CBC_OnedEAN8Writer::FilterContents( - const CFX_WideStringC& contents) { - CFX_WideString filtercontents; +WideString CBC_OnedEAN8Writer::FilterContents(const WideStringView& contents) { + WideString filtercontents; wchar_t ch; for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { ch = contents[i]; @@ -84,11 +83,11 @@ CFX_WideString CBC_OnedEAN8Writer::FilterContents( return filtercontents; } -int32_t CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString& contents) { +int32_t CBC_OnedEAN8Writer::CalcChecksum(const ByteString& contents) { return EANCalcChecksum(contents); } -uint8_t* CBC_OnedEAN8Writer::EncodeWithHint(const CFX_ByteString& contents, +uint8_t* CBC_OnedEAN8Writer::EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, @@ -99,7 +98,7 @@ uint8_t* CBC_OnedEAN8Writer::EncodeWithHint(const CFX_ByteString& contents, hints); } -uint8_t* CBC_OnedEAN8Writer::EncodeImpl(const CFX_ByteString& contents, +uint8_t* CBC_OnedEAN8Writer::EncodeImpl(const ByteString& contents, int32_t& outLength) { if (contents.GetLength() != 8) return nullptr; @@ -136,7 +135,7 @@ uint8_t* CBC_OnedEAN8Writer::EncodeImpl(const CFX_ByteString& contents, return result.release(); } -bool CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, +bool CBC_OnedEAN8Writer::ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, @@ -145,10 +144,10 @@ bool CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, return false; int32_t leftPosition = 3 * multiple; - CFX_ByteString str = FX_UTF8Encode(contents); + ByteString str = FX_UTF8Encode(contents); FX_STRSIZE iLength = str.GetLength(); std::vector<FXTEXT_CHARPOS> charpos(iLength); - CFX_ByteString tempStr = str.Left(4); + ByteString tempStr = str.Left(4); FX_STRSIZE iLen = tempStr.GetLength(); int32_t strWidth = 7 * multiple * 4; float blank = 0.0; |