Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::XmlNode Class Reference

Node of a DOM tree. More...

#include <arcane/core/XmlNode.h>

Inheritance diagram for Arcane::XmlNode:
Collaboration diagram for Arcane::XmlNode:

Public Types

enum  eType {
  ELEMENT = 1 , ATTRIBUTE = 2 , TEXT = 3 , CDATA_SECTION = 4 ,
  ENTITY_REFERENCE = 5 , ENTITY = 6 , PROCESSING_INSTRUCTION = 7 , COMMENT = 8 ,
  DOCUMENT = 9 , DOCUMENT_TYPE = 10 , DOCUMENT_FRAGMENT = 11 , NOTATION = 12
}
 NodeType An integer indicating which type of node this is. More...
typedef XmlNode value_type
 Type of the elements in the array.
typedef XmlNodeIterator iterator
 Type of the iterator over an element in the array.
typedef XmlNodeConstIterator const_iterator
 Type of the constant iterator over an element in the array.
typedef value_typepointer
 Type pointer of an element in the array.
typedef const value_typeconst_pointer
 Type constant pointer of an element in the array.
typedef value_typereference
 Type reference of an element in the array.
typedef const value_typeconst_reference
 Type constant reference of an element in the array.
typedef Integer size_type
 Type indexing the array.
typedef int difference_type
 Type of a distance between iterator elements in the array.
typedef IterT< XmlNode > iter
 Type of an iterator over the entire array.
typedef ConstIterT< XmlNode > const_iter
 Type of a constant iterator over the entire array.

Public Member Functions

 XmlNode (IRessourceMng *m, const dom::Node &node)
 XmlNode (IRessourceMng *m)
iterator begin ()
 Returns an iterator over the first element of the array.
iterator end ()
 Returns an iterator over the first element after the end of the array.
const_iterator begin () const
 Returns a constant iterator over the first element of the array.
const_iterator end () const
 Returns a constant iterator over the first element after the end of the array.
eType type () const
 Node type.
String name () const
 Node name.
String xpathFullName () const
 XPath name of the node with its ancestors.
bool isNamed (const String &name) const
 True if the element name is name.
String value () const
 Node value.
Integer valueAsInteger (bool throw_exception=false) const
 Node value converted to integer.
Int64 valueAsInt64 (bool throw_exception=false) const
 Node value converted to 64-bit integer. 0 if conversion fails.
bool valueAsBoolean (bool throw_exception=false) const
 Node value converted to boolean.
Real valueAsReal (bool throw_exception=false) const
 Node value converted to real number. If conversion fails, if throw_exception is false returns 0.0, otherwise throws an exception.
void setValue (const String &value)
 Sets the node value.
String attrValue (const String &name, bool throw_exception=false) const
 Value of attribute name.
void setAttrValue (const String &name, const String &value)
 Sets the attribute name to the value value.
XmlNode attr (const String &name, bool throw_exception=false) const
 Returns the attribute of name name.
XmlNode forceAttr (const String &name)
 Returns the attribute of name name. If no attribute with this name exists, an attribute with the null string as value is created and returned.
void removeAttr (const String &name) const
 Removes the attribute of name name from this node. If this node is not an element, nothing is done.
XmlNode documentElement () const
 Returns the document element.
XmlNode ownerElement () const
 Returns the owning element of this attribute.
void clear ()
 Deletes all child nodes.
XmlNode child (const String &name) const
 Child node of this node with name name.
XmlNode expectedChild (const String &name) const
 Child node of this node with name name.
XmlNodeList children (const String &name) const
 Set of child nodes of this node having the name name.
XmlNodeList children () const
 Set of child nodes of this node.
XmlNode parent () const
 Parent of this node (null if none).
void append (const XmlNode &child_node)
 Adds child_node as a child of this node.
void remove (const XmlNode &child_node)
 Removes the child node child_node.
void replace (const XmlNode &new_node, XmlNode &ref_node)
 Replaces the child node ref_node with the node new_node.
void remove ()
 Removes this node from the document.
XmlNode front () const
 First child.
XmlNode last () const
 Last child.
XmlNode next () const
 Next node (nextSibling()).
XmlNode prev () const
 Previous node (previousSibling()).
XmlNode nextWithName (const String &name) const
 Returns the next node after this node having the name name.
XmlNode prevWithName (const String &name) const
 Returns the previous node before this node having the name name.
XmlNode nextSameType () const
 Returns the next node of the same type.
XmlNode prevSameType () const
 Returns the previous node of the same type.
void operator++ ()
void operator-- ()
bool null () const
 True if the node is null.
bool operator! () const
dom::Node domNode () const
void assignDomNode (const dom::Node &node)
XmlNode insertAfter (const XmlNode &new_child, const XmlNode &ref_node)
 Inserts a node. Inserts the node new_child after the node ref_node. If new_child is null, does nothing. If ref_node is null, new_child is added to the end (like append()). Otherwise, ref_node must be a child of this node and new_child is inserted after ref_node. On success, returns the added node (new_child), otherwise the null node.
XmlNode childWithAttr (const String &elem_name, const String &attr_name, const String &attr_value) const
 Returns the child of this node having the name elem_name and an attribute of name attr_name with value attr_value.
XmlNode childWithNameAttr (const String &elem_name, const String &attr_value) const
 Returns the child of this node having the name elem_name and an attribute of name "name" with value attr_value.
XmlNode xpathNode (const String &xpath_expr) const
 Returns a node from an XPath expression.
XmlNode createNode (eType type, const String &name, const String &value)
 Creates a node of a given type.
XmlNode createNode (eType type, const String &name_or_value)
 Creates a node of a given type.
XmlNode createText (const String &value)
 Creates a text node.
XmlNode createElement (const String &name)
XmlNode createAndAppendElement (const String &name)
XmlNode createAndAppendElement (const String &name, const String &value)
XmlNode ownerDocument () const
IRessourceMngrm () const

Protected Member Functions

String _value () const
XmlNode _build (const dom::Node &node) const
XmlNode _nullNode () const
void _setNode (const dom::Node &n)
void _throwBadConvert (const char *type_name, const String &value) const

Private Attributes

IRessourceMngm_rm
dom::Node m_node

Detailed Description

Node of a DOM tree.

This class is used for all types of DOM nodes and allows them to be manipulated more simply than with the DOM without having to perform type conversions.

Each node can be considered a container in the sense of the STL.

Definition at line 50 of file XmlNode.h.

Member Typedef Documentation

◆ const_iter

Type of a constant iterator over the entire array.

Definition at line 76 of file XmlNode.h.

◆ const_iterator

Type of the constant iterator over an element in the array.

Definition at line 59 of file XmlNode.h.

◆ const_pointer

Type constant pointer of an element in the array.

Definition at line 63 of file XmlNode.h.

◆ const_reference

Type constant reference of an element in the array.

Definition at line 67 of file XmlNode.h.

◆ difference_type

Type of a distance between iterator elements in the array.

Definition at line 71 of file XmlNode.h.

◆ iter

typedef IterT<XmlNode> Arcane::XmlNode::iter

Type of an iterator over the entire array.

Definition at line 74 of file XmlNode.h.

◆ iterator

Type of the iterator over an element in the array.

Definition at line 57 of file XmlNode.h.

◆ pointer

Type pointer of an element in the array.

Definition at line 61 of file XmlNode.h.

◆ reference

Type reference of an element in the array.

Definition at line 65 of file XmlNode.h.

◆ size_type

Type indexing the array.

Definition at line 69 of file XmlNode.h.

◆ value_type

typedef XmlNode Arcane::XmlNode::value_type

Type of the elements in the array.

Definition at line 55 of file XmlNode.h.

Member Enumeration Documentation

◆ eType

NodeType An integer indicating which type of node this is.

Note
Numeric codes up to 200 are reserved to W3C for possible future use.
Enumerator
ELEMENT 

The node is an Element.

ATTRIBUTE 

The node is an Attr.

TEXT 

The node is a Text node.

CDATA_SECTION 

The node is a CDATASection.

ENTITY_REFERENCE 

The node is an EntityReference.

ENTITY 

The node is an Entity.

PROCESSING_INSTRUCTION 

The node is a ProcessingInstruction.

COMMENT 

The node is a Comment.

DOCUMENT 

The node is a Document.

DOCUMENT_TYPE 

The node is a DocumentType.

DOCUMENT_FRAGMENT 

The node is a DocumentFragment.

NOTATION 

The node is a Notation.

Definition at line 84 of file XmlNode.h.

Constructor & Destructor Documentation

◆ XmlNode() [1/3]

Arcane::XmlNode::XmlNode ( IRessourceMng * m,
const dom::Node & node )
inline

Definition at line 114 of file XmlNode.h.

◆ XmlNode() [2/3]

Arcane::XmlNode::XmlNode ( IRessourceMng * m)
inlineexplicit

Definition at line 119 of file XmlNode.h.

◆ XmlNode() [3/3]

Arcane::XmlNode::XmlNode ( )
inline

Definition at line 123 of file XmlNode.h.

Member Function Documentation

◆ _build()

XmlNode Arcane::XmlNode::_build ( const dom::Node & node) const
protected

Definition at line 678 of file XmlNode.cc.

◆ _nullNode()

XmlNode Arcane::XmlNode::_nullNode ( ) const
protected

Definition at line 63 of file XmlNode.cc.

◆ _setNode()

void Arcane::XmlNode::_setNode ( const dom::Node & n)
inlineprotected

Definition at line 394 of file XmlNode.h.

◆ _throwBadConvert()

void Arcane::XmlNode::_throwBadConvert ( const char * type_name,
const String & value ) const
inlineprotected

Definition at line 410 of file XmlNode.cc.

◆ _value()

String Arcane::XmlNode::_value ( ) const
protected

Definition at line 526 of file XmlNode.cc.

◆ append()

void Arcane::XmlNode::append ( const XmlNode & child_node)
inline

Adds child_node as a child of this node.

The node is added after all children.

Definition at line 276 of file XmlNode.h.

References domNode().

Referenced by insertAfter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignDomNode()

void Arcane::XmlNode::assignDomNode ( const dom::Node & node)

Definition at line 537 of file XmlNode.cc.

Referenced by createNode(), and createNode().

Here is the caller graph for this function:

◆ attr()

XmlNode Arcane::XmlNode::attr ( const String & name,
bool throw_exception = false ) const

Returns the attribute of name name.

If the attribute does not exist, if throw_exception is false returns a null node, otherwise throws an exception.

Definition at line 256 of file XmlNode.cc.

References ARCANE_THROW, name(), null(), and xpathFullName().

Referenced by Arcane::TimeLoopMng::_fillModuleStateMap(), Arcane::LegacyMeshBuilder::_readMesh(), forceAttr(), Arcane::Hdf5VariableReaderHelper2::open(), Arcane::Hdf5VariableReaderHelper::open(), ownerElement(), Arcane::MeshGeneratorService::readMeshFromFile(), and Arcane::TimeHistoryMngInternal::readVariables().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ attrValue()

String Arcane::XmlNode::attrValue ( const String & name,
bool throw_exception = false ) const

Value of attribute name.

If the attribute does not exist, if throw_exception is false returns the null string, otherwise throws an exception.

Definition at line 233 of file XmlNode.cc.

References ARCANE_THROW, name(), Arcane::String::null(), and xpathFullName().

Referenced by Arcane::TimeLoopMng::_fillModuleStateMap(), Arcane::ConfigurationReader::addValuesFromXmlNode(), Arcane::CaseDocument::build(), Arcane::Hdf5VariableReaderHelper::open(), Arcane::CaseOptions::read(), Arcane::LimaMeshReaderService::readMeshFromFile(), and Arcane::TimeLoopReader::readTimeLoops().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [1/2]

XmlNodeIterator Arcane::XmlNode::begin ( )
inline

Returns an iterator over the first element of the array.

Definition at line 100 of file XmlNodeIterator.h.

Referenced by Arcane::XmlElementContentChecker::check(), child(), children(), and children().

Here is the caller graph for this function:

◆ begin() [2/2]

XmlNodeConstIterator Arcane::XmlNode::begin ( ) const
inline

Returns a constant iterator over the first element of the array.

Definition at line 112 of file XmlNodeIterator.h.

◆ child()

XmlNode Arcane::XmlNode::child ( const String & name) const

Child node of this node with name name.

If multiple nodes with this name exist, returns the first one. If the node is not found, returns a null node

Definition at line 72 of file XmlNode.cc.

References begin(), and end().

Referenced by Arcane::VariableIOReaderMng::_readMetaData(), Arcane::LimaCutInfosReader::_readUniqueIndexFromXml(), Arcane::CaseDocument::build(), Arcane::InternalInfosDumper::dumpInternalAllInfos(), expectedChild(), Arcane::MeshGeneratorService::readMeshFromFile(), Arcane::TimeLoopReader::readTimeLoops(), Arcane::TimeHistoryMngInternal::readVariables(), and remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ children() [1/2]

XmlNodeList Arcane::XmlNode::children ( ) const

Set of child nodes of this node.

Definition at line 117 of file XmlNode.cc.

References Arcane::Array< T >::add(), begin(), and end().

Here is the call graph for this function:

◆ children() [2/2]

XmlNodeList Arcane::XmlNode::children ( const String & name) const

Set of child nodes of this node having the name name.

Definition at line 101 of file XmlNode.cc.

References Arcane::Array< T >::add(), begin(), and end().

Referenced by Arcane::VtkMeshIOService::_readData(), Arcane::LimaCutInfosReader::_readUniqueIndexFromXml(), Arcane::CaseOptionMultiExtended::_search(), Arcane::ConfigurationReader::addValuesFromXmlNode(), Arcane::CaseDocument::build(), Arcane::mesh::DynamicMesh::initializeVariables(), Arcane::Hdf5VariableReaderHelper2::open(), Arcane::Hdf5VariableReaderHelper::open(), Arcane::TimeLoopReader::readTimeLoops(), and Arcane::TimeHistoryMngInternal::readVariables().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ childWithAttr()

XmlNode Arcane::XmlNode::childWithAttr ( const String & elem_name,
const String & attr_name,
const String & attr_value ) const

Returns the child of this node having the name elem_name and an attribute of name attr_name with value attr_value.

Definition at line 488 of file XmlNode.cc.

References name(), and null().

Referenced by childWithNameAttr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ childWithNameAttr()

XmlNode Arcane::XmlNode::childWithNameAttr ( const String & elem_name,
const String & attr_value ) const

Returns the child of this node having the name elem_name and an attribute of name "name" with value attr_value.

Definition at line 508 of file XmlNode.cc.

References childWithAttr().

Referenced by Arcane::MeshGeneratorService::readMeshFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void Arcane::XmlNode::clear ( )

Deletes all child nodes.

Definition at line 301 of file XmlNode.cc.

References front(), null(), and remove().

Referenced by Arcane::CheckpointMng::_writeCheckpointInfoFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAndAppendElement() [1/2]

XmlNode Arcane::XmlNode::createAndAppendElement ( const String & name)

Definition at line 608 of file XmlNode.cc.

◆ createAndAppendElement() [2/2]

XmlNode Arcane::XmlNode::createAndAppendElement ( const String & name,
const String & value )

Definition at line 597 of file XmlNode.cc.

◆ createElement()

XmlNode Arcane::XmlNode::createElement ( const String & name)

Definition at line 588 of file XmlNode.cc.

◆ createNode() [1/2]

XmlNode Arcane::XmlNode::createNode ( eType type,
const String & name,
const String & value )

Creates a node of a given type.

If type() is not DOCUMENT_NODE, it uses ownerDocument() as factory.

Parameters
typetype of the node.
nameof the node.
valueof the node.
Returns
the created node.
Precondition
type()==DOCUMENT_NODE

Definition at line 653 of file XmlNode.cc.

References ARCANE_THROW, assignDomNode(), ELEMENT, name(), setValue(), TEXT, type(), and value().

Referenced by createText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createNode() [2/2]

XmlNode Arcane::XmlNode::createNode ( eType type,
const String & name_or_value )

Creates a node of a given type.

If type() is not DOCUMENT_NODE, it uses ownerDocument() as factory.

Parameters
typetype of the node.
nameor value of the node in the case where the node has no name.
Returns
the created node.

Definition at line 619 of file XmlNode.cc.

References ARCANE_THROW, assignDomNode(), ELEMENT, TEXT, and type().

Here is the call graph for this function:

◆ createText()

XmlNode Arcane::XmlNode::createText ( const String & value)

Creates a text node.

Parameters
valuevalue of the text node.
Returns
the created node.

Definition at line 644 of file XmlNode.cc.

References createNode(), TEXT, and value().

Here is the call graph for this function:

◆ documentElement()

XmlNode Arcane::XmlNode::documentElement ( ) const

Returns the document element.

Precondition
type()==DOCUMENT_NODE

Definition at line 564 of file XmlNode.cc.

Referenced by Arcane::Application::_openUserConfig(), Arcane::VtkMeshIOService::_readData(), Arcane::Hdf5VariableReaderHelper2::open(), and Arcane::Hdf5VariableReaderHelper::open().

Here is the caller graph for this function:

◆ domNode()

dom::Node Arcane::XmlNode::domNode ( ) const
inline

Definition at line 307 of file XmlNode.h.

Referenced by append(), insertAfter(), remove(), replace(), and Arcane::IOMng::writeXmlFile().

Here is the caller graph for this function:

◆ end() [1/2]

XmlNodeIterator Arcane::XmlNode::end ( )
inline

Returns an iterator over the first element after the end of the array.

Definition at line 106 of file XmlNodeIterator.h.

Referenced by Arcane::XmlElementContentChecker::check(), child(), children(), and children().

Here is the caller graph for this function:

◆ end() [2/2]

XmlNodeConstIterator Arcane::XmlNode::end ( ) const
inline

Returns a constant iterator over the first element after the end of the array.

Definition at line 118 of file XmlNodeIterator.h.

◆ expectedChild()

XmlNode Arcane::XmlNode::expectedChild ( const String & name) const

Child node of this node with name name.

If multiple nodes with this name exist, returns the first one. If the node is not found, throws an exception.

Definition at line 87 of file XmlNode.cc.

References ARCANE_FATAL, child(), null(), and xpathFullName().

Here is the call graph for this function:

◆ forceAttr()

XmlNode Arcane::XmlNode::forceAttr ( const String & name)

Returns the attribute of name name. If no attribute with this name exists, an attribute with the null string as value is created and returned.

Definition at line 274 of file XmlNode.cc.

References attr(), and name().

Here is the call graph for this function:

◆ front()

XmlNode Arcane::XmlNode::front ( ) const
inline

First child.

Definition at line 284 of file XmlNode.h.

Referenced by clear(), and xpathFullName().

Here is the caller graph for this function:

◆ insertAfter()

XmlNode Arcane::XmlNode::insertAfter ( const XmlNode & new_child,
const XmlNode & ref_node )

Inserts a node. Inserts the node new_child after the node ref_node. If new_child is null, does nothing. If ref_node is null, new_child is added to the end (like append()). Otherwise, ref_node must be a child of this node and new_child is inserted after ref_node. On success, returns the added node (new_child), otherwise the null node.

Definition at line 546 of file XmlNode.cc.

References append(), domNode(), next(), and null().

Here is the call graph for this function:

◆ isNamed()

bool Arcane::XmlNode::isNamed ( const String & name) const

True if the element name is name.

Definition at line 198 of file XmlNode.cc.

References name().

Referenced by nextWithName(), and prevWithName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ last()

XmlNode Arcane::XmlNode::last ( ) const
inline

Last child.

Definition at line 286 of file XmlNode.h.

◆ name()

String Arcane::XmlNode::name ( ) const

Node name.

Definition at line 140 of file XmlNode.cc.

Referenced by Arcane::CaseMng::_searchInvalidOptions(), attr(), attrValue(), childWithAttr(), createNode(), forceAttr(), isNamed(), nextWithName(), prevWithName(), Arcane::TimeLoopReader::readTimeLoops(), removeAttr(), setAttrValue(), Arcane::XmlElement::XmlElement(), Arcane::XmlElement::XmlElement(), and xpathFullName().

Here is the caller graph for this function:

◆ next()

XmlNode Arcane::XmlNode::next ( ) const
inline

Next node (nextSibling()).

Definition at line 288 of file XmlNode.h.

Referenced by insertAfter(), nextSameType(), and nextWithName().

Here is the caller graph for this function:

◆ nextSameType()

XmlNode Arcane::XmlNode::nextSameType ( ) const

Returns the next node of the same type.

Definition at line 369 of file XmlNode.cc.

References next(), null(), and type().

Here is the call graph for this function:

◆ nextWithName()

XmlNode Arcane::XmlNode::nextWithName ( const String & name) const

Returns the next node after this node having the name name.

Definition at line 339 of file XmlNode.cc.

References isNamed(), name(), next(), and null().

Here is the call graph for this function:

◆ null()

◆ operator!()

bool Arcane::XmlNode::operator! ( ) const
inline

Definition at line 304 of file XmlNode.h.

◆ operator++()

void Arcane::XmlNode::operator++ ( )
inline

Definition at line 299 of file XmlNode.h.

◆ operator--()

void Arcane::XmlNode::operator-- ( )
inline

Definition at line 300 of file XmlNode.h.

◆ ownerDocument()

XmlNode Arcane::XmlNode::ownerDocument ( ) const
inline

Definition at line 380 of file XmlNode.h.

◆ ownerElement()

XmlNode Arcane::XmlNode::ownerElement ( ) const

Returns the owning element of this attribute.

Precondition
type()==ATTRIBUTE_NODE

Definition at line 576 of file XmlNode.cc.

References attr().

Referenced by xpathFullName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parent()

XmlNode Arcane::XmlNode::parent ( ) const
inline

Parent of this node (null if none).

Definition at line 270 of file XmlNode.h.

Referenced by remove(), Arcane::XmlElement::XmlElement(), Arcane::XmlElement::XmlElement(), and xpathFullName().

Here is the caller graph for this function:

◆ prev()

XmlNode Arcane::XmlNode::prev ( ) const
inline

Previous node (previousSibling()).

Definition at line 290 of file XmlNode.h.

Referenced by prevSameType(), and prevWithName().

Here is the caller graph for this function:

◆ prevSameType()

XmlNode Arcane::XmlNode::prevSameType ( ) const

Returns the previous node of the same type.

Definition at line 384 of file XmlNode.cc.

References null(), prev(), and type().

Here is the call graph for this function:

◆ prevWithName()

XmlNode Arcane::XmlNode::prevWithName ( const String & name) const

Returns the previous node before this node having the name name.

Definition at line 354 of file XmlNode.cc.

References isNamed(), name(), null(), and prev().

Here is the call graph for this function:

◆ remove() [1/2]

void Arcane::XmlNode::remove ( )

Removes this node from the document.

Definition at line 315 of file XmlNode.cc.

References parent().

Referenced by clear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove() [2/2]

void Arcane::XmlNode::remove ( const XmlNode & child_node)

Removes the child node child_node.

Definition at line 329 of file XmlNode.cc.

References child(), and domNode().

Here is the call graph for this function:

◆ removeAttr()

void Arcane::XmlNode::removeAttr ( const String & name) const

Removes the attribute of name name from this node. If this node is not an element, nothing is done.

Definition at line 291 of file XmlNode.cc.

References name().

Here is the call graph for this function:

◆ replace()

void Arcane::XmlNode::replace ( const XmlNode & new_node,
XmlNode & ref_node )

Replaces the child node ref_node with the node new_node.

Definition at line 399 of file XmlNode.cc.

References domNode(), and null().

Here is the call graph for this function:

◆ rm()

IRessourceMng * Arcane::XmlNode::rm ( ) const
inline

Definition at line 382 of file XmlNode.h.

◆ setAttrValue()

void Arcane::XmlNode::setAttrValue ( const String & name,
const String & value )

Sets the attribute name to the value value.

Definition at line 247 of file XmlNode.cc.

References name(), and value().

Referenced by Arcane::VariableIOWriterMng::_generateMeshesMetaData(), Arcane::CheckpointMng::_writeCheckpointInfoFile(), Arcane::InternalInfosDumper::dumpInternalAllInfos(), Arcane::SubDomain::dumpInternalInfos(), Arcane::UnitTestServiceAdapter< T >::executeTest(), Arcane::ManualHdf5VariableWriter::notifyEndWrite(), and Arcane::ArcaneCurveWriter::writeCurve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setValue()

void Arcane::XmlNode::setValue ( const String & value)

Sets the node value.

This method is only valid for ELEMENT_NODE or ATTRIBUTE_NODE. For elements, it deletes all children and adds a single TEXT_NODE child containing the value value

Definition at line 218 of file XmlNode.cc.

References Arcane::dom::Node::ELEMENT_NODE.

Referenced by createNode().

Here is the caller graph for this function:

◆ type()

XmlNode::eType Arcane::XmlNode::type ( ) const

Node type.

Definition at line 131 of file XmlNode.cc.

Referenced by Arcane::XmlElementContentChecker::check(), createNode(), createNode(), nextSameType(), and prevSameType().

Here is the caller graph for this function:

◆ value()

String Arcane::XmlNode::value ( ) const

Node value.

For an element, it is the concatenation of the values of each of its child nodes of type TEXT, CDATA_SECTION or ENTITY_REFERENCE. For nodes other than elements, it is the value of the Node::nodeValue() method of the DOM.

Definition at line 207 of file XmlNode.cc.

References null().

Referenced by Arcane::VariableIOReaderMng::_readMetaData(), Arcane::LimaCutInfosReader::_readUniqueIndexFromXml(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), Arcane::XmlElementContentChecker::check(), createNode(), createText(), setAttrValue(), Arcane::TimeLoopReader::setUsedTimeLoop(), valueAsBoolean(), valueAsInt64(), valueAsInteger(), valueAsReal(), and Arcane::XmlElement::XmlElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueAsBoolean()

bool Arcane::XmlNode::valueAsBoolean ( bool throw_exception = false) const

Node value converted to boolean.

A value of false or 0 corresponds to false. A value of true or 1 corresponds to true. If conversion fails, if throw_exception is false returns false, otherwise throws an exception.

Definition at line 420 of file XmlNode.cc.

References ARCANE_THROW, null(), value(), and xpathFullName().

Referenced by Arcane::TimeLoopMng::_fillModuleStateMap(), and Arcane::MeshGeneratorService::readMeshFromFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueAsInt64()

Int64 Arcane::XmlNode::valueAsInt64 ( bool throw_exception = false) const

Node value converted to 64-bit integer. 0 if conversion fails.

If conversion fails, if throw_exception is false returns 0, otherwise throws an exception.

Definition at line 456 of file XmlNode.cc.

References null(), and value().

Here is the call graph for this function:

◆ valueAsInteger()

Integer Arcane::XmlNode::valueAsInteger ( bool throw_exception = false) const

Node value converted to integer.

If conversion fails, if throw_exception is false returns 0, otherwise throws an exception.

Definition at line 440 of file XmlNode.cc.

References null(), and value().

Referenced by Arcane::LegacyMeshBuilder::_readMesh(), and Arcane::TimeHistoryMngInternal::readVariables().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueAsReal()

Real Arcane::XmlNode::valueAsReal ( bool throw_exception = false) const

Node value converted to real number. If conversion fails, if throw_exception is false returns 0.0, otherwise throws an exception.

Definition at line 472 of file XmlNode.cc.

References null(), and value().

Referenced by Arcane::Hdf5VariableReaderHelper2::open(), and Arcane::Hdf5VariableReaderHelper::open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xpathFullName()

String Arcane::XmlNode::xpathFullName ( ) const

XPath name of the node with its ancestors.

Warning
Only works for elements.

Definition at line 151 of file XmlNode.cc.

References Arcane::StringBuilder::append(), Arcane::dom::Node::ATTRIBUTE_NODE, Arcane::dom::Node::ELEMENT_NODE, front(), name(), null(), ownerElement(), parent(), and xpathFullName().

Referenced by Arcane::CaseOptionError::addInvalidTypeError(), Arcane::CaseOptionError::addInvalidTypeError(), Arcane::CaseOptionError::addOptionNotFoundError(), attr(), attrValue(), Arcane::XmlElementContentChecker::check(), expectedChild(), Arcane::Hdf5VariableReaderHelper2::open(), Arcane::Hdf5VariableReaderHelper::open(), Arcane::CaseOptions::read(), valueAsBoolean(), and xpathFullName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xpathNode()

XmlNode Arcane::XmlNode::xpathNode ( const String & xpath_expr) const

Returns a node from an XPath expression.

Parameters
xpath_exprXPath expression.

Definition at line 517 of file XmlNode.cc.

Member Data Documentation

◆ m_node

dom::Node Arcane::XmlNode::m_node
private

Definition at line 387 of file XmlNode.h.

◆ m_rm

IRessourceMng* Arcane::XmlNode::m_rm
private

Definition at line 386 of file XmlNode.h.


The documentation for this class was generated from the following files: