Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_xmldocument.h
Go to the documentation of this file.
1// Copyright 2018 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CORE_FXCRT_XML_CFX_XMLDOCUMENT_H_
6#define CORE_FXCRT_XML_CFX_XMLDOCUMENT_H_
7
8#include <memory>
9#include <utility>
10#include <vector>
11
12#include "core/fxcrt/unowned_ptr.h"
13
14class CFX_XMLElement;
15class CFX_XMLNode;
16
18 public:
21
22 CFX_XMLElement* GetRoot() const { return root_; }
23
24 template <typename T, typename... Args>
25 T* CreateNode(Args&&... args) {
26 nodes_.push_back(std::make_unique<T>(std::forward<Args>(args)...));
27 return static_cast<T*>(nodes_.back().get());
28 }
29
30 // Transfers ownership of entries in |nodes_| from |other| to |this|.
31 // This is used in CJX_Node::loadXML to transfer ownership of the newly
32 // created nodes to the top-level XML doc for the PDF, after parsing an XML
33 // blob.
35
36 private:
37 std::vector<std::unique_ptr<CFX_XMLNode>> nodes_;
38 UnownedPtr<CFX_XMLElement> root_;
39};
40
41#endif // CORE_FXCRT_XML_CFX_XMLDOCUMENT_H_
CFX_XMLElement * GetRoot() const
T * CreateNode(Args &&... args)
void AppendNodesFrom(CFX_XMLDocument *other)
WideString GetAttribute(const WideString &name) const
std::vector< UnsupportedFeature > CheckForSharedForm() const
CPDF_Metadata(RetainPtr< const CPDF_Stream > pStream)
static WideString FromASCII(ByteStringView str)
bool EqualsASCII(ByteStringView that) const
Definition widestring.h:216
UnsupportedFeature