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 
52 {
55 
56 public:
59 
64 
66 
70 
71 public:
73  unsigned long get_length() const;
74 
78 
79 public:
81  DomNode get_named_item(const DomString &name) const;
82 
85  const DomString &namespace_uri,
86  const DomString &local_name) const;
87 
89 
96 
98 
101 
103 
107 
109 
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 
DomNamedNodeMap(const std::shared_ptr< DomNamedNodeMap_Impl > &impl)
Constructs a DomNamedNodeMap.
DomNode item(unsigned long index) const
Returns the indexth item in the map.
DomNode remove_named_item(const DomString &name)
Removes a node specified by name.
DOM Named Node Map class.
Definition: dom_named_node_map.h:52
std::shared_ptr< DomNamedNodeMap_Impl > impl
Definition: dom_named_node_map.h:130
DomNode get_named_item_ns(const DomString &namespace_uri, const DomString &local_name) const
Retrieves a node specified by namespace URI and local name.
DomNamedNodeMap(const DomNamedNodeMap &copy)
Constructs a DomNamedNodeMap.
DomNamedNodeMap()
Constructs a DOM NamedNodeMap handle.
DOM Node class.
Definition: dom_node.h:71
Definition: clanapp.h:36
std::string DomString
Definition: dom_string.h:37
unsigned long get_length() const
The number of nodes in the map.
DomNode remove_named_item_ns(const DomString &namespace_uri, const DomString &local_name)
Removes a node specified by namespace URI and local name.
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 set_named_item(const DomNode &node)
Adds a node using its node name attribute.