12#ifndef ARCANE_CORE_XMLNODE_H
13#define ARCANE_CORE_XMLNODE_H
17#include "arcane/utils/String.h"
18#include "arcane/core/Dom.h"
50class ARCANE_CORE_EXPORT XmlNode
119 explicit XmlNode(IRessourceMng* m)
131 inline iterator begin();
133 inline iterator end();
135 inline const_iterator begin()
const;
137 inline const_iterator end()
const;
150 String xpathFullName()
const;
153 bool isNamed(
const String& name)
const;
162 String value()
const;
169 Integer valueAsInteger(
bool throw_exception =
false)
const;
176 Int64 valueAsInt64(
bool throw_exception =
false)
const;
185 bool valueAsBoolean(
bool throw_exception =
false)
const;
191 Real valueAsReal(
bool throw_exception =
false)
const;
199 void setValue(
const String& value);
206 String attrValue(
const String& name,
bool throw_exception =
false)
const;
209 void setAttrValue(
const String& name,
const String& value);
217 XmlNode attr(
const String& name,
bool throw_exception =
false)
const;
224 XmlNode forceAttr(
const String& name);
230 void removeAttr(
const String& name)
const;
236 XmlNode documentElement()
const;
242 XmlNode ownerElement()
const;
253 XmlNode child(
const String& name)
const;
261 XmlNode expectedChild(
const String& name)
const;
264 XmlNodeList children(
const String& name)
const;
267 XmlNodeList children()
const;
270 XmlNode
parent()
const {
return XmlNode(m_rm, m_node.parentNode()); }
276 void append(
const XmlNode& child_node) { m_node.appendChild(child_node.
domNode()); }
278 void remove(
const XmlNode& child_node);
284 XmlNode
front()
const {
return XmlNode(m_rm, m_node.firstChild()); }
286 XmlNode
last()
const {
return XmlNode(m_rm, m_node.lastChild()); }
288 XmlNode
next()
const {
return XmlNode(m_rm, m_node.nextSibling()); }
290 XmlNode
prev()
const {
return XmlNode(m_rm, m_node.previousSibling()); }
299 void operator++() { m_node = m_node.nextSibling(); }
300 void operator--() { m_node = m_node.previousSibling(); }
303 bool null()
const {
return m_node._null(); }
304 bool operator!()
const {
return null(); }
309 void assignDomNode(
const dom::Node& node);
327 const String& attr_value)
const;
333 const String& attr_value)
const;
380 XmlNode ownerDocument()
const {
return XmlNode(m_rm, m_node.ownerDocument()); }
382 IRessourceMng* rm()
const {
return m_rm; }
391 String _value()
const;
392 XmlNode _build(
const dom::Node& node)
const;
393 XmlNode _nullNode()
const;
394 void _setNode(
const dom::Node& n) { m_node = n; }
395 inline void _throwBadConvert(
const char* type_name,
const String& value)
const;
431operator!=(
const XmlNode& n1,
const XmlNode& n2)
433 return n1.domNode() != n2.domNode();
Constant iterator interval.
Interface of a resource manager.
Iterator intervalThis class manages an iterator pair allowing modification of the elements of the con...
Unicode character string.
XmlElement(XmlNode &parent, const String &name, const String &value)
Creates a child element of parent. The created element has the name name and the value value....
List of nodes of a DOM tree.
int difference_type
Type of a distance between iterator elements in the array.
Integer size_type
Type indexing the array.
XmlNode value_type
Type of the elements in the array.
value_type & reference
Type reference of an element in the array.
const value_type & const_reference
Type constant reference of an element in the array.
value_type * pointer
Type pointer of an element in the array.
const value_type * const_pointer
Type constant pointer of an element in the array.
XmlNodeIterator iterator
Type of the iterator over an element in the array.
XmlNode prev() const
Previous node (previousSibling()).
XmlNodeConstIterator const_iterator
Type of the constant iterator over an element in the array.
void append(const XmlNode &child_node)
Adds child_node as a child of this node.
String value() const
Node value.
IterT< XmlNode > iter
Type of an iterator over the entire array.
XmlNode front() const
First child.
bool null() const
True if the node is null.
XmlNode next() const
Next node (nextSibling()).
eType
NodeType An integer indicating which type of node this is.
@ TEXT
The node is a Text node.
@ ATTRIBUTE
The node is an Attr.
@ ENTITY
The node is an Entity.
@ ELEMENT
The node is an Element.
@ DOCUMENT_TYPE
The node is a DocumentType.
@ ENTITY_REFERENCE
The node is an EntityReference.
@ COMMENT
The node is a Comment.
@ NOTATION
The node is a Notation.
@ CDATA_SECTION
The node is a CDATASection.
@ PROCESSING_INSTRUCTION
The node is a ProcessingInstruction.
@ DOCUMENT
The node is a Document.
@ DOCUMENT_FRAGMENT
The node is a DocumentFragment.
ConstIterT< XmlNode > const_iter
Type of a constant iterator over the entire array.
XmlNode parent() const
Parent of this node (null if none).
String name() const
Node name.
XmlNode last() const
Last child.
dom::Node domNode() const
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.