From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: 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 Commit-Queue: Ryan Harrison --- core/fxcrt/xml/cfx_xmlnode.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'core/fxcrt/xml/cfx_xmlnode.cpp') 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""; - pXMLStream->WriteString(ws.AsStringC()); + pXMLStream->WriteString(ws.AsStringView()); } else { ws.Format(L"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"&"); wsValue.Replace(L"<", L"<"); wsValue.Replace(L">", L">"); @@ -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(pNode)->GetName(); - pXMLStream->WriteString(ws.AsStringC()); + pXMLStream->WriteString(ws.AsStringView()); for (auto it : static_cast(pNode)->GetAttributes()) { - CFX_WideString wsValue = it.second; + WideString wsValue = it.second; wsValue.Replace(L"&", L"&"); wsValue.Replace(L"<", L"<"); wsValue.Replace(L">", L">"); @@ -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(pNode)->GetText(); + WideString ws = static_cast(pNode)->GetText(); ws.Replace(L"&", L"&"); ws.Replace(L"<", L"<"); ws.Replace(L">", L">"); ws.Replace(L"\'", L"'"); ws.Replace(L"\"", L"""); - pXMLStream->WriteString(ws.AsStringC()); + pXMLStream->WriteString(ws.AsStringView()); break; } case FX_XMLNODE_CharData: { - CFX_WideString ws = L"(pNode)->GetText(); ws += L"]]>"; - pXMLStream->WriteString(ws.AsStringC()); + pXMLStream->WriteString(ws.AsStringView()); break; } case FX_XMLNODE_Unknown: -- cgit v1.2.3