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 /fpdfsdk/javascript/util.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 'fpdfsdk/javascript/util.cpp')
-rw-r--r-- | fpdfsdk/javascript/util.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp index e00f9e1560..04f1eb36cd 100644 --- a/fpdfsdk/javascript/util.cpp +++ b/fpdfsdk/javascript/util.cpp @@ -76,7 +76,7 @@ util::~util() {} bool util::printf(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, - CFX_WideString& sError) { + WideString& sError) { const size_t iSize = params.size(); if (iSize < 1) return false; @@ -111,7 +111,7 @@ bool util::printf(CJS_Runtime* pRuntime, continue; } - CFX_WideString strSegment; + WideString strSegment; switch (ParseDataType(&c_strFormat)) { case UTIL_INT: strSegment.Format(c_strFormat.c_str(), params[iIndex].ToInt(pRuntime)); @@ -139,7 +139,7 @@ bool util::printf(CJS_Runtime* pRuntime, bool util::printd(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, - CFX_WideString& sError) { + WideString& sError) { const size_t iSize = params.size(); if (iSize < 2) return false; @@ -158,7 +158,7 @@ bool util::printd(CJS_Runtime* pRuntime, } if (p1.GetType() == CJS_Value::VT_number) { - CFX_WideString swResult; + WideString swResult; switch (p1.ToInt(pRuntime)) { case 0: swResult.Format(L"D:%04d%02d%02d%02d%02d%02d", jsDate.GetYear(pRuntime), @@ -231,7 +231,7 @@ bool util::printd(CJS_Runtime* pRuntime, }; for (size_t i = 0; i < FX_ArraySize(cTableAd); ++i) { - CFX_WideString sValue; + WideString sValue; sValue.Format(L"%d", cTableAd[i].iValue); int iStart = 0; @@ -271,7 +271,7 @@ bool util::printd(CJS_Runtime* pRuntime, bool util::printx(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, - CFX_WideString& sError) { + WideString& sError) { if (params.size() < 2) { sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); return false; @@ -294,9 +294,9 @@ static wchar_t TranslateCase(wchar_t input, CaseMode eMode) { return input; } -CFX_WideString util::printx(const CFX_WideString& wsFormat, - const CFX_WideString& wsSource) { - CFX_WideString wsResult; +WideString util::printx(const WideString& wsFormat, + const WideString& wsSource) { + WideString wsResult; FX_STRSIZE iSourceIdx = 0; FX_STRSIZE iFormatIdx = 0; CaseMode eCaseMode = kPreserveCase; @@ -385,12 +385,12 @@ CFX_WideString util::printx(const CFX_WideString& wsFormat, bool util::scand(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, - CFX_WideString& sError) { + WideString& sError) { if (params.size() < 2) return false; - CFX_WideString sFormat = params[0].ToCFXWideString(pRuntime); - CFX_WideString sDate = params[1].ToCFXWideString(pRuntime); + WideString sFormat = params[0].ToCFXWideString(pRuntime); + WideString sDate = params[1].ToCFXWideString(pRuntime); double dDate = JS_GetDateTime(); if (sDate.GetLength() > 0) { dDate = CJS_PublicMethods::MakeRegularDate(sDate, sFormat, nullptr); @@ -408,7 +408,7 @@ bool util::scand(CJS_Runtime* pRuntime, bool util::byteToChar(CJS_Runtime* pRuntime, const std::vector<CJS_Value>& params, CJS_Value& vRet, - CFX_WideString& sError) { + WideString& sError) { if (params.size() < 1) { sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR); return false; @@ -420,7 +420,7 @@ bool util::byteToChar(CJS_Runtime* pRuntime, return false; } - CFX_WideString wStr(static_cast<wchar_t>(arg)); + WideString wStr(static_cast<wchar_t>(arg)); vRet = CJS_Value(pRuntime, wStr.c_str()); return true; } |