dom_named_node_map.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 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
35 namespace clan
36 {
39
40 class DomNode;
41 class DomNamedNodeMap_Impl;
42
51 class DomNamedNodeMap
52 {
55
56 public:
58 DomNamedNodeMap();
59
63 DomNamedNodeMap(const DomNamedNodeMap &copy);
64
65 ~DomNamedNodeMap();
66
70
71 public:
73 unsigned long get_length() const;
74
78
79 public:
81 DomNode get_named_item(const DomString &name) const;
82
84 DomNode get_named_item_ns(
85 const DomString &namespace_uri,
86 const DomString &local_name) const;
87
89
95 DomNode set_named_item(const DomNode &node);
96
98
100 DomNode set_named_item_ns(const DomNode &node);
101
103
106 DomNode remove_named_item(const DomString &name);
107
109
111 DomNode remove_named_item_ns(
112 const DomString &namespace_uri,
113 const DomString &local_name);
114
116
117 DomNode item(unsigned long index) const;
118
122
123 protected:
124
128 DomNamedNodeMap(const std::shared_ptr<DomNamedNodeMap_Impl> &impl);
129
130 std::shared_ptr<DomNamedNodeMap_Impl> impl;
131
132 friend class DomNode;
134 };
135
136 }
137
clan::DomNamedNodeMap::~DomNamedNodeMap
~DomNamedNodeMap()
clan
Definition: clanapp.h:35
clan::DomNamedNodeMap::get_named_item_ns
DomNode get_named_item_ns(const DomString &namespace_uri, const DomString &local_name) const
Retrieves a node specified by namespace URI and local name.
clan::DomNamedNodeMap::DomNamedNodeMap
DomNamedNodeMap()
Constructs a DOM NamedNodeMap handle.
clan::DomNamedNodeMap::set_named_item
DomNode set_named_item(const DomNode &node)
Adds a node using its node name attribute.
clan::DomString
std::string DomString
Definition: dom_string.h:37
clan::DomNode
DOM Node class.
Definition: dom_node.h:70
clan::DomNamedNodeMap::set_named_item_ns
DomNode set_named_item_ns(const DomNode &node)
Adds a node using its namespace URI and local name.
clan::DomNamedNodeMap::remove_named_item_ns
DomNode remove_named_item_ns(const DomString &namespace_uri, const DomString &local_name)
Removes a node specified by namespace URI and local name.
clan::DomNamedNodeMap::remove_named_item
DomNode remove_named_item(const DomString &name)
Removes a node specified by name.
clan::DomNamedNodeMap::get_named_item
DomNode get_named_item(const DomString &name) const
Retrieves a node specified by name.
clan::DomNamedNodeMap::item
DomNode item(unsigned long index) const
Returns the indexth item in the map.
clan::DomNamedNodeMap::impl
std::shared_ptr< DomNamedNodeMap_Impl > impl
Definition: dom_named_node_map.h:130
clan::DomNamedNodeMap
DOM Named Node Map class.
Definition: dom_named_node_map.h:51
clan::DomNamedNodeMap::get_length
unsigned long get_length() const
The number of nodes in the map.