summaryrefslogtreecommitdiff
path: root/xfa/fde/xml
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-18 11:54:04 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 17:53:07 +0000
commit5ae87922cb96810a05b2262c66b55b7e8f00e46d (patch)
tree4acc973ec8693b2a00222a06786aeebcbdfd3443 /xfa/fde/xml
parenteccf405a479292144aa04dae4e02dae3edbba84e (diff)
downloadpdfium-5ae87922cb96810a05b2262c66b55b7e8f00e46d.tar.xz
Update IFGAS_Stream::WriteString to take a string.
This Cl updates the WriteString method to accept a CFX_WideString. Change-Id: I9f480abf32f4132f8ca33799e673a9e8540285f6 Reviewed-on: https://pdfium-review.googlesource.com/4151 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/xml')
-rw-r--r--xfa/fde/xml/cfde_xmldoc.cpp22
-rw-r--r--xfa/fde/xml/cfde_xmlnode.cpp22
2 files changed, 22 insertions, 22 deletions
diff --git a/xfa/fde/xml/cfde_xmldoc.cpp b/xfa/fde/xml/cfde_xmldoc.cpp
index 7032700578..209ce9c68f 100644
--- a/xfa/fde/xml/cfde_xmldoc.cpp
+++ b/xfa/fde/xml/cfde_xmldoc.cpp
@@ -65,10 +65,10 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
ws += L"UTF-8";
}
ws += L"\"?>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
} else {
ws.Format(L"<?%s", pInstruction->GetName().c_str());
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
for (auto it : pInstruction->GetAttributes()) {
CFX_WideString wsValue = it.second;
@@ -83,17 +83,17 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
for (auto target : pInstruction->GetTargetData()) {
ws = L" \"";
ws += target;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
ws = L"?>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
break;
}
@@ -101,7 +101,7 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
CFX_WideString ws;
ws = L"<";
ws += static_cast<CFDE_XMLElement*>(pNode)->GetName();
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
for (auto it : static_cast<CFDE_XMLElement*>(pNode)->GetAttributes()) {
CFX_WideString wsValue = it.second;
@@ -116,11 +116,11 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
if (pNode->m_pChild) {
ws = L"\n>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
CFDE_XMLNode* pChild = pNode->m_pChild;
while (pChild) {
SaveXMLNode(pXMLStream, static_cast<CFDE_XMLNode*>(pChild));
@@ -132,7 +132,7 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
} else {
ws = L"\n/>";
}
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_Text: {
@@ -142,14 +142,14 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream,
ws.Replace(L">", L"&gt;");
ws.Replace(L"\'", L"&apos;");
ws.Replace(L"\"", L"&quot;");
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_CharData: {
CFX_WideString ws = L"<![CDATA[";
ws += static_cast<CFDE_XMLCharData*>(pNode)->GetText();
ws += L"]]>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_Unknown:
diff --git a/xfa/fde/xml/cfde_xmlnode.cpp b/xfa/fde/xml/cfde_xmlnode.cpp
index 82db939a23..e4d7880cac 100644
--- a/xfa/fde/xml/cfde_xmlnode.cpp
+++ b/xfa/fde/xml/cfde_xmlnode.cpp
@@ -346,10 +346,10 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
ws += L"UTF-8";
}
ws += L"\"?>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
} else {
ws.Format(L"<?%s", pInstruction->GetName().c_str());
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
for (auto it : pInstruction->GetAttributes()) {
CFX_WideString wsValue = it.second;
@@ -364,17 +364,17 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
for (auto target : pInstruction->GetTargetData()) {
ws = L" \"";
ws += target;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
ws = L"?>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
break;
}
@@ -382,7 +382,7 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
CFX_WideString ws;
ws = L"<";
ws += static_cast<CFDE_XMLElement*>(pNode)->GetName();
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
for (auto it : static_cast<CFDE_XMLElement*>(pNode)->GetAttributes()) {
CFX_WideString wsValue = it.second;
@@ -397,11 +397,11 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
ws += L"=\"";
ws += wsValue;
ws += L"\"";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
}
if (pNode->m_pChild) {
ws = L"\n>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
CFDE_XMLNode* pChild = pNode->m_pChild;
while (pChild) {
pChild->SaveXMLNode(pXMLStream);
@@ -413,7 +413,7 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
} else {
ws = L"\n/>";
}
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_Text: {
@@ -423,14 +423,14 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<IFGAS_Stream>& pXMLStream) {
ws.Replace(L">", L"&gt;");
ws.Replace(L"\'", L"&apos;");
ws.Replace(L"\"", L"&quot;");
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_CharData: {
CFX_WideString ws = L"<![CDATA[";
ws += static_cast<CFDE_XMLCharData*>(pNode)->GetText();
ws += L"]]>";
- pXMLStream->WriteString(ws.c_str(), ws.GetLength());
+ pXMLStream->WriteString(ws.AsStringC());
break;
}
case FDE_XMLNODE_Unknown: