summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cxml_element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cxml_element.cpp')
-rw-r--r--core/fxcrt/xml/cxml_element.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/fxcrt/xml/cxml_element.cpp b/core/fxcrt/xml/cxml_element.cpp
index 17caebfa14..95a6dba147 100644
--- a/core/fxcrt/xml/cxml_element.cpp
+++ b/core/fxcrt/xml/cxml_element.cpp
@@ -9,6 +9,15 @@
#include "core/fxcrt/xml/cxml_content.h"
#include "core/fxcrt/xml/cxml_parser.h"
+// static
+std::unique_ptr<CXML_Element> CXML_Element::Parse(const void* pBuffer,
+ size_t size) {
+ CXML_Parser parser;
+ if (!parser.Init(static_cast<const uint8_t*>(pBuffer), size))
+ return nullptr;
+ return parser.ParseElement(nullptr, false);
+}
+
CXML_Element::CXML_Element(const CXML_Element* pParent,
const CFX_ByteStringC& qSpace,
const CFX_ByteStringC& tagname)