aboutsummaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlnode.h
blob: 5934bc7036ba54fee7834966ab8ab5c49c201bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef CORE_FXCRT_XML_CFX_XMLNODE_H_
#define CORE_FXCRT_XML_CFX_XMLNODE_H_

#include "core/fxcrt/fx_stream.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/tree_node.h"

class CFX_XMLDocument;

class CFX_XMLNode : public TreeNode<CFX_XMLNode> {
 public:
  enum class Type {
    kInstruction = 0,
    kElement,
    kText,
    kCharData,
  };

  CFX_XMLNode();
  ~CFX_XMLNode() override;

  virtual Type GetType() const = 0;
  virtual CFX_XMLNode* Clone(CFX_XMLDocument* doc) = 0;
  virtual void Save(const RetainPtr<IFX_RetainableWriteStream>& pXMLStream) = 0;

  CFX_XMLNode* GetRoot();
  void InsertChildNode(CFX_XMLNode* pNode, int32_t index);
};

#endif  // CORE_FXCRT_XML_CFX_XMLNODE_H_