summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlnode.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 /core/fxcrt/xml/cfx_xmlnode.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 'core/fxcrt/xml/cfx_xmlnode.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlnode.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/core/fxcrt/xml/cfx_xmlnode.cpp b/core/fxcrt/xml/cfx_xmlnode.cpp
index 47b3105f10..7a893af4a0 100644
--- a/core/fxcrt/xml/cfx_xmlnode.cpp
+++ b/core/fxcrt/xml/cfx_xmlnode.cpp
@@ -84,7 +84,7 @@ CFX_XMLNode* CFX_XMLNode::GetPath(const wchar_t* pPath,
if (iLength == 0) {
return nullptr;
}
- CFX_WideString csPath;
+ WideString csPath;
const wchar_t* pStart = pPath;
const wchar_t* pEnd = pPath + iLength;
wchar_t ch;
@@ -105,7 +105,7 @@ CFX_XMLNode* CFX_XMLNode::GetPath(const wchar_t* pPath,
} else if (csPath.Compare(L".") == 0) {
pFind = (CFX_XMLNode*)this;
} else {
- CFX_WideString wsTag;
+ WideString wsTag;
CFX_XMLNode* pNode = m_pChild;
while (pNode) {
if (pNode->GetType() == FX_XMLNODE_Element) {
@@ -334,7 +334,7 @@ void CFX_XMLNode::SaveXMLNode(
CFX_XMLNode* pNode = (CFX_XMLNode*)this;
switch (pNode->GetType()) {
case FX_XMLNODE_Instruction: {
- CFX_WideString ws;
+ WideString ws;
CFX_XMLInstruction* pInstruction = (CFX_XMLInstruction*)pNode;
if (pInstruction->GetName().CompareNoCase(L"xml") == 0) {
ws = L"<?xml version=\"1.0\" encoding=\"";
@@ -347,13 +347,13 @@ void CFX_XMLNode::SaveXMLNode(
ws += L"UTF-8";
}
ws += L"\"?>";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
} else {
ws.Format(L"<?%s", pInstruction->GetName().c_str());
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
for (auto it : pInstruction->GetAttributes()) {
- CFX_WideString wsValue = it.second;
+ WideString wsValue = it.second;
wsValue.Replace(L"&", L"&amp;");
wsValue.Replace(L"<", L"&lt;");
wsValue.Replace(L">", L"&gt;");
@@ -365,28 +365,28 @@ void CFX_XMLNode::SaveXMLNode(
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
}
for (auto target : pInstruction->GetTargetData()) {
ws = L" \"";
ws += target;
ws += L"\"";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
}
ws = L"?>";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
}
break;
}
case FX_XMLNODE_Element: {
- CFX_WideString ws;
+ WideString ws;
ws = L"<";
ws += static_cast<CFX_XMLElement*>(pNode)->GetName();
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
for (auto it : static_cast<CFX_XMLElement*>(pNode)->GetAttributes()) {
- CFX_WideString wsValue = it.second;
+ WideString wsValue = it.second;
wsValue.Replace(L"&", L"&amp;");
wsValue.Replace(L"<", L"&lt;");
wsValue.Replace(L">", L"&gt;");
@@ -398,11 +398,11 @@ void CFX_XMLNode::SaveXMLNode(
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
}
if (pNode->m_pChild) {
ws = L"\n>";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
CFX_XMLNode* pChild = pNode->m_pChild;
while (pChild) {
pChild->SaveXMLNode(pXMLStream);
@@ -414,24 +414,24 @@ void CFX_XMLNode::SaveXMLNode(
} else {
ws = L"\n/>";
}
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
break;
}
case FX_XMLNODE_Text: {
- CFX_WideString ws = static_cast<CFX_XMLText*>(pNode)->GetText();
+ WideString ws = static_cast<CFX_XMLText*>(pNode)->GetText();
ws.Replace(L"&", L"&amp;");
ws.Replace(L"<", L"&lt;");
ws.Replace(L">", L"&gt;");
ws.Replace(L"\'", L"&apos;");
ws.Replace(L"\"", L"&quot;");
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
break;
}
case FX_XMLNODE_CharData: {
- CFX_WideString ws = L"<![CDATA[";
+ WideString ws = L"<![CDATA[";
ws += static_cast<CFX_XMLCharData*>(pNode)->GetText();
ws += L"]]>";
- pXMLStream->WriteString(ws.AsStringC());
+ pXMLStream->WriteString(ws.AsStringView());
break;
}
case FX_XMLNODE_Unknown: