summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_GlobalData.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fpdfsdk/javascript/JS_GlobalData.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-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/JS_GlobalData.cpp')
-rw-r--r--fpdfsdk/javascript/JS_GlobalData.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp
index 14202646c5..ce3ce68fb3 100644
--- a/fpdfsdk/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/javascript/JS_GlobalData.cpp
@@ -32,7 +32,7 @@ const uint8_t JS_RC4KEY[] = {
0xf8, 0x77, 0xd5, 0xa3};
// Returns true if non-empty, setting sPropName
-bool TrimPropName(CFX_ByteString* sPropName) {
+bool TrimPropName(ByteString* sPropName) {
sPropName->TrimLeft();
sPropName->TrimRight();
return sPropName->GetLength() != 0;
@@ -69,7 +69,7 @@ CJS_GlobalData::~CJS_GlobalData() {
}
CJS_GlobalData::iterator CJS_GlobalData::FindGlobalVariable(
- const CFX_ByteString& propname) {
+ const ByteString& propname) {
for (auto it = m_arrayGlobalData.begin(); it != m_arrayGlobalData.end();
++it) {
if ((*it)->data.sKey == propname)
@@ -79,7 +79,7 @@ CJS_GlobalData::iterator CJS_GlobalData::FindGlobalVariable(
}
CJS_GlobalData::const_iterator CJS_GlobalData::FindGlobalVariable(
- const CFX_ByteString& propname) const {
+ const ByteString& propname) const {
for (auto it = m_arrayGlobalData.begin(); it != m_arrayGlobalData.end();
++it) {
if ((*it)->data.sKey == propname)
@@ -89,14 +89,14 @@ CJS_GlobalData::const_iterator CJS_GlobalData::FindGlobalVariable(
}
CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(
- const CFX_ByteString& propname) {
+ const ByteString& propname) {
auto iter = FindGlobalVariable(propname);
return iter != m_arrayGlobalData.end() ? iter->get() : nullptr;
}
-void CJS_GlobalData::SetGlobalVariableNumber(const CFX_ByteString& propname,
+void CJS_GlobalData::SetGlobalVariableNumber(const ByteString& propname,
double dData) {
- CFX_ByteString sPropName(propname);
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return;
@@ -112,9 +112,9 @@ void CJS_GlobalData::SetGlobalVariableNumber(const CFX_ByteString& propname,
m_arrayGlobalData.push_back(std::move(pNewData));
}
-void CJS_GlobalData::SetGlobalVariableBoolean(const CFX_ByteString& propname,
+void CJS_GlobalData::SetGlobalVariableBoolean(const ByteString& propname,
bool bData) {
- CFX_ByteString sPropName(propname);
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return;
@@ -130,9 +130,9 @@ void CJS_GlobalData::SetGlobalVariableBoolean(const CFX_ByteString& propname,
m_arrayGlobalData.push_back(std::move(pNewData));
}
-void CJS_GlobalData::SetGlobalVariableString(const CFX_ByteString& propname,
- const CFX_ByteString& sData) {
- CFX_ByteString sPropName(propname);
+void CJS_GlobalData::SetGlobalVariableString(const ByteString& propname,
+ const ByteString& sData) {
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return;
@@ -149,9 +149,9 @@ void CJS_GlobalData::SetGlobalVariableString(const CFX_ByteString& propname,
}
void CJS_GlobalData::SetGlobalVariableObject(
- const CFX_ByteString& propname,
+ const ByteString& propname,
const CJS_GlobalVariableArray& array) {
- CFX_ByteString sPropName(propname);
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return;
@@ -167,8 +167,8 @@ void CJS_GlobalData::SetGlobalVariableObject(
m_arrayGlobalData.push_back(std::move(pNewData));
}
-void CJS_GlobalData::SetGlobalVariableNull(const CFX_ByteString& propname) {
- CFX_ByteString sPropName(propname);
+void CJS_GlobalData::SetGlobalVariableNull(const ByteString& propname) {
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return;
@@ -182,9 +182,9 @@ void CJS_GlobalData::SetGlobalVariableNull(const CFX_ByteString& propname) {
m_arrayGlobalData.push_back(std::move(pNewData));
}
-bool CJS_GlobalData::SetGlobalVariablePersistent(const CFX_ByteString& propname,
+bool CJS_GlobalData::SetGlobalVariablePersistent(const ByteString& propname,
bool bPersistent) {
- CFX_ByteString sPropName(propname);
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return false;
@@ -196,8 +196,8 @@ bool CJS_GlobalData::SetGlobalVariablePersistent(const CFX_ByteString& propname,
return true;
}
-bool CJS_GlobalData::DeleteGlobalVariable(const CFX_ByteString& propname) {
- CFX_ByteString sPropName(propname);
+bool CJS_GlobalData::DeleteGlobalVariable(const ByteString& propname) {
+ ByteString sPropName(propname);
if (!TrimPropName(&sPropName))
return false;
@@ -254,7 +254,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
if (p + dwNameLen > pBuffer + nLength)
break;
- CFX_ByteString sEntry = CFX_ByteString(p, dwNameLen);
+ ByteString sEntry = ByteString(p, dwNameLen);
p += sizeof(char) * dwNameLen;
JS_GlobalDataType wDataType =
@@ -291,7 +291,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() {
if (p + dwLength > pBuffer + nLength)
break;
- SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength));
+ SetGlobalVariableString(sEntry, ByteString(p, dwLength));
SetGlobalVariablePersistent(sEntry, true);
p += sizeof(char) * dwLength;
} break;
@@ -353,7 +353,7 @@ void CJS_GlobalData::WriteFileBuffer(const wchar_t* sFilePath,
// UnSupport.
}
-void CJS_GlobalData::MakeByteString(const CFX_ByteString& name,
+void CJS_GlobalData::MakeByteString(const ByteString& name,
CJS_KeyValue* pData,
CFX_BinaryBuf& sData) {
switch (pData->nType) {