summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmldoc.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-12 13:15:59 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 13:15:59 +0000
commita995d6fd9b862dbd37aebb9c323766bb5d11d389 (patch)
treedb204479d0c854d1e30840794972d5115cbe80f4 /core/fxcrt/xml/cfx_xmldoc.h
parent332139df2c3c0826069fa61bcd436309fcdf5a6f (diff)
downloadpdfium-a995d6fd9b862dbd37aebb9c323766bb5d11d389.tar.xz
Allow retrieving the XML tree from the CFX_XMLDoc
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the CFX_XMLDoc. This way, we don't have to keep the doc around and can store the pointer to the tree in the CXFA_SimpleParser. Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c Reviewed-on: https://pdfium-review.googlesource.com/30210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmldoc.h')
-rw-r--r--core/fxcrt/xml/cfx_xmldoc.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/fxcrt/xml/cfx_xmldoc.h b/core/fxcrt/xml/cfx_xmldoc.h
index 55976b01b3..915acd325d 100644
--- a/core/fxcrt/xml/cfx_xmldoc.h
+++ b/core/fxcrt/xml/cfx_xmldoc.h
@@ -8,6 +8,7 @@
#define CORE_FXCRT_XML_CFX_XMLDOC_H_
#include <memory>
+#include <utility>
#include "core/fxcrt/cfx_seekablestreamproxy.h"
#include "core/fxcrt/retain_ptr.h"
@@ -16,18 +17,15 @@
class CFX_XMLDoc {
public:
- explicit CFX_XMLDoc(const RetainPtr<CFX_SeekableStreamProxy>& pStream);
+ CFX_XMLDoc();
~CFX_XMLDoc();
- int32_t Load();
- void CloseXML();
+ bool Load(const RetainPtr<CFX_SeekableStreamProxy>& pStream);
- CFX_XMLNode* GetRoot() const { return m_pRoot.get(); }
- CFX_XMLParser* GetParser() const { return m_pXMLParser.get(); }
+ std::unique_ptr<CFX_XMLNode> GetTree() { return std::move(m_pRoot); }
private:
std::unique_ptr<CFX_XMLNode> m_pRoot;
- std::unique_ptr<CFX_XMLParser> m_pXMLParser;
};
#endif // CORE_FXCRT_XML_CFX_XMLDOC_H_