dom_named_node_map.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27*/
28
29
30#pragma once
31
32#include <memory>
33#include "dom_string.h"
34
35namespace clan
36{
39
40 class DomNode;
41 class DomNamedNodeMap_Impl;
42
52 {
53 public:
56
61
63
65 unsigned long get_length() const;
66
68 DomNode get_named_item(const DomString &name) const;
69
72 const DomString &namespace_uri,
73 const DomString &local_name) const;
74
76
83
85
88
90
94
96
99 const DomString &namespace_uri,
100 const DomString &local_name);
101
103
104 DomNode item(unsigned long index) const;
105
106 protected:
107 DomNamedNodeMap(const std::shared_ptr<DomNamedNodeMap_Impl> &impl);
108 std::shared_ptr<DomNamedNodeMap_Impl> impl;
109 friend class DomNode;
110 };
111
113}
DOM Named Node Map class.
Definition dom_named_node_map.h:52
DomNode remove_named_item_ns(const DomString &namespace_uri, const DomString &local_name)
Removes a node specified by namespace URI and local name.
unsigned long get_length() const
The number of nodes in the map.
std::shared_ptr< DomNamedNodeMap_Impl > impl
Definition dom_named_node_map.h:108
DomNode item(unsigned long index) const
Returns the indexth item in the map.
DomNamedNodeMap(const std::shared_ptr< DomNamedNodeMap_Impl > &impl)
DomNamedNodeMap()
Constructs a DOM NamedNodeMap handle.
DomNode set_named_item(const DomNode &node)
Adds a node using its node name attribute.
DomNode remove_named_item(const DomString &name)
Removes a node specified by name.
DomNamedNodeMap(const DomNamedNodeMap &copy)
Constructs a DomNamedNodeMap.
DomNode set_named_item_ns(const DomNode &node)
Adds a node using its namespace URI and local name.
DomNode get_named_item(const DomString &name) const
Retrieves a node specified by name.
DomNode get_named_item_ns(const DomString &namespace_uri, const DomString &local_name) const
Retrieves a node specified by namespace URI and local name.
DOM Node class.
Definition dom_node.h:71
std::string DomString
Definition dom_string.h:37
Definition clanapp.h:36