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>
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index e00f9e1..04f1eb3 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -76,7 +76,7 @@
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 @@
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::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 @@
}
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 @@
};
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::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 @@
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 @@
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::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 @@
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;
}