DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Class to easily access the properties of single XmlElements. More...
#include <XMLElements.h>
Public Types | |
typedef XmlElement * | Elt_t |
Public Member Functions | |
Handle_t (Elt_t e=0) | |
Initializing constructor. More... | |
Elt_t | operator-> () const |
Direct access to the XmlElement using the operator-> More... | |
operator Elt_t () const | |
Direct access to the XmlElement by dereferencing. More... | |
Elt_t | ptr () const |
Direct access to the XmlElement by function. More... | |
Handle_t | clone (XmlDocument *new_doc) const |
Clone the DOMelement - with the option of a deep copy. More... | |
const XmlChar * | rawTag () const |
Unicode text access to the element's tag. Tis must be wrong .... More... | |
const XmlChar * | rawText () const |
Unicode text access to the element's text. More... | |
const XmlChar * | rawValue () const |
Unicode text access to the element's value. More... | |
std::string | tag () const |
Text access to the element's tag. More... | |
std::string | text () const |
Text access to the element's text. More... | |
std::string | value () const |
Text access to the element's value. More... | |
void | setValue (const XmlChar *text) const |
Set the element's value. More... | |
void | setValue (const std::string &text) const |
Set the element's value. More... | |
void | setText (const XmlChar *text) const |
Set the element's text. More... | |
void | setText (const std::string &text) const |
Set the element's text. More... | |
const XmlChar * | attr_name (const Attribute attr) const |
Access attribute name (throws exception if not present) More... | |
const XmlChar * | attr_value (const Attribute attr) const |
Access attribute value by the attribute (throws exception if not present) More... | |
const XmlChar * | attr_value (const XmlChar *attr) const |
Access attribute value by the attribute's unicode name (throws exception if not present) More... | |
const XmlChar * | attr_value_nothrow (const XmlChar *attr) const |
Access attribute value by the attribute's unicode name (no exception thrown if not present) More... | |
Attribute | attr_ptr (const XmlChar *attr) const |
Access attribute pointer by the attribute's unicode name (throws exception if not present) More... | |
Attribute | attr_nothrow (const XmlChar *tag) const |
Access attribute pointer by the attribute's unicode name (no exception thrown if not present) More... | |
bool | hasAttr (const XmlChar *t) const |
Check for the existence of a named attribute. More... | |
std::vector< Attribute > | attributes () const |
Retrieve a collection of all attributes of this DOM element. More... | |
template<class T > | |
T | attr (const Attribute a) const |
Access typed attribute value by the XmlAttr. More... | |
void | removeAttrs () const |
Remove all attributes of this element. More... | |
void | setAttrs (Handle_t e) const |
Set attributes as in argument handle. More... | |
template<class T > | |
T | attr (const XmlChar *name) const |
Access typed attribute value by its unicode name. More... | |
template<class T > | |
T | attr (const XmlChar *name, T default_value) const |
Access typed attribute value by its unicode name. If not existing returns default value. More... | |
Attribute | setAttr (const XmlChar *t, const XmlChar *v) const |
Generic attribute setter with unicode value. More... | |
Attribute | setAttr (const XmlChar *t, const Attribute v) const |
Generic attribute setter with XmlAttr value. More... | |
Attribute | setAttr (const XmlChar *t, int val) const |
Generic attribute setter with integer value. More... | |
Attribute | setAttr (const XmlChar *t, bool val) const |
Generic attribute setter with boolen value. More... | |
Attribute | setAttr (const XmlChar *t, float val) const |
Generic attribute setter with floating point value. More... | |
Attribute | setAttr (const XmlChar *t, double val) const |
Generic attribute setter with double precision floating point value. More... | |
Attribute | setAttr (const XmlChar *t, const std::string &val) const |
Generic attribute setter with string value. More... | |
bool | hasAttr (const char *t) const |
Check for the existence of a named attribute. More... | |
template<class T > | |
T | attr (const char *name) const |
Access typed attribute value by its name. More... | |
template<class T > | |
T | attr (const char *name, const T &default_value) const |
Access typed attribute value by its name. More... | |
Attribute | setAttr (const XmlChar *t, const char *v) const |
Generic attribute setter with text value. More... | |
Handle_t | setRef (const XmlChar *tag, const XmlChar *ref) |
Add reference child as a new child node. The obj must have the "name" attribute! More... | |
Handle_t | setRef (const XmlChar *tag, const std::string &ref) |
Add reference child as a new child node. The obj must have the "name" attribute! More... | |
bool | hasChild (const XmlChar *tag) const |
Check the existence of a child with a given tag name. More... | |
Handle_t | child (const XmlChar *tag, bool throw_exception=true) const |
Access a single child by its tag name (unicode) More... | |
NodeList | children (const XmlChar *tag) const |
Access a group of children identified by the same tag name. More... | |
size_t | numChildren (const XmlChar *tag, bool throw_exception) const |
Access the number of children of this DOM element with a given tag name. More... | |
Handle_t | remove (Handle_t e) const |
Remove a single child node identified by its handle from the tree of the element. More... | |
void | removeChildren (const XmlChar *tag) const |
Remove children with a given tag name from the DOM node. More... | |
void | append (Handle_t e) const |
Append a DOM element to the current node. More... | |
Handle_t | parent () const |
Access the element's parent element. More... | |
unsigned int | checksum (unsigned int param, unsigned int(fcn)(unsigned int param, const XmlChar *, size_t)=0) const |
Checksum (sub-)tree of a xml document/tree. Default will pick up the adler32 checksum. More... | |
template<> | |
INLINE Attribute | attr (const XmlChar *tag_value) const |
template<> | |
INLINE cpXmlChar | attr (const XmlChar *tag_value) const |
template<> | |
INLINE bool | attr (const XmlChar *tag_value) const |
template<> | |
INLINE int | attr (const XmlChar *tag_value) const |
template<> | |
INLINE unsigned int | attr (const XmlChar *tag_value) const |
template<> | |
INLINE long | attr (const XmlChar *tag_value) const |
template<> | |
INLINE unsigned long | attr (const XmlChar *tag_value) const |
template<> | |
INLINE float | attr (const XmlChar *tag_value) const |
template<> | |
INLINE double | attr (const XmlChar *tag_value) const |
template<> | |
INLINE Attribute | attr (const XmlChar *tag_value, Attribute default_value) const |
template<> | |
INLINE bool | attr (const XmlChar *tag_value, bool default_value) const |
template<> | |
INLINE int | attr (const XmlChar *tag_value, int default_value) const |
template<> | |
INLINE unsigned int | attr (const XmlChar *tag_value, unsigned int default_value) const |
template<> | |
INLINE long | attr (const XmlChar *tag_value, long default_value) const |
template<> | |
INLINE unsigned long | attr (const XmlChar *tag_value, unsigned long default_value) const |
template<> | |
INLINE float | attr (const XmlChar *tag_value, float default_value) const |
template<> | |
INLINE double | attr (const XmlChar *tag_value, double default_value) const |
Public Attributes | |
Elt_t | m_node |
The pointer to the XmlElement. More... | |
Class to easily access the properties of single XmlElements.
Note: The assignmant operator as well as the copy constructor do not have to be implemented, they are aut-generated by the compiler!
Definition at line 380 of file XMLElements.h.
typedef XmlElement* dd4hep::xml::Handle_t::Elt_t |
Definition at line 383 of file XMLElements.h.
|
inline |
Initializing constructor.
Definition at line 389 of file XMLElements.h.
void Handle_t::append | ( | Handle_t | e | ) | const |
Append a DOM element to the current node.
Definition at line 727 of file XMLElements.cpp.
|
inline |
Access typed attribute value by the XmlAttr.
Definition at line 454 of file XMLElements.h.
|
inline |
Access typed attribute value by its name.
Definition at line 486 of file XMLElements.h.
|
inline |
Access typed attribute value by its name.
Definition at line 490 of file XMLElements.h.
T dd4hep::xml::Handle_t::attr | ( | const XmlChar * | name | ) | const |
Access typed attribute value by its unicode name.
T dd4hep::xml::Handle_t::attr | ( | const XmlChar * | name, |
T | default_value | ||
) | const |
Access typed attribute value by its unicode name. If not existing returns default value.
Definition at line 528 of file XMLElements.h.
Definition at line 532 of file XMLElements.h.
Definition at line 536 of file XMLElements.h.
Definition at line 540 of file XMLElements.h.
Definition at line 544 of file XMLElements.h.
Definition at line 548 of file XMLElements.h.
Definition at line 552 of file XMLElements.h.
Definition at line 556 of file XMLElements.h.
Definition at line 560 of file XMLElements.h.
INLINE Attribute dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
Attribute | default_value | ||
) | const |
Definition at line 568 of file XMLElements.h.
INLINE bool dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
bool | default_value | ||
) | const |
Definition at line 573 of file XMLElements.h.
INLINE double dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
double | default_value | ||
) | const |
Definition at line 603 of file XMLElements.h.
INLINE float dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
float | default_value | ||
) | const |
Definition at line 598 of file XMLElements.h.
INLINE int dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
int | default_value | ||
) | const |
Definition at line 578 of file XMLElements.h.
INLINE long dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
long | default_value | ||
) | const |
Definition at line 588 of file XMLElements.h.
INLINE unsigned int dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
unsigned int | default_value | ||
) | const |
Definition at line 583 of file XMLElements.h.
INLINE unsigned long dd4hep::xml::Handle_t::attr | ( | const XmlChar * | tag_value, |
unsigned long | default_value | ||
) | const |
Definition at line 593 of file XMLElements.h.
Access attribute name (throws exception if not present)
Definition at line 851 of file XMLElements.cpp.
Access attribute pointer by the attribute's unicode name (no exception thrown if not present)
Definition at line 668 of file XMLElements.cpp.
Access attribute pointer by the attribute's unicode name (throws exception if not present)
Definition at line 838 of file XMLElements.cpp.
Access attribute value by the attribute (throws exception if not present)
Definition at line 864 of file XMLElements.cpp.
Access attribute value by the attribute's unicode name (throws exception if not present)
Definition at line 859 of file XMLElements.cpp.
Access attribute value by the attribute's unicode name (no exception thrown if not present)
Definition at line 869 of file XMLElements.cpp.
std::vector< Attribute > Handle_t::attributes | ( | ) | const |
Retrieve a collection of all attributes of this DOM element.
Definition at line 678 of file XMLElements.cpp.
unsigned int Handle_t::checksum | ( | unsigned int | param, |
unsigned | intfcn)(unsigned int param, const XmlChar *, size_t = 0 |
||
) | const |
Checksum (sub-)tree of a xml document/tree. Default will pick up the adler32 checksum.
Definition at line 990 of file XMLElements.cpp.
Access a single child by its tag name (unicode)
Remove a single child node identified by its handle from the tree of the element.
Definition at line 710 of file XMLElements.cpp.
Access a group of children identified by the same tag name.
Definition at line 722 of file XMLElements.cpp.
Handle_t Handle_t::clone | ( | XmlDocument * | new_doc | ) | const |
Clone the DOMelement - with the option of a deep copy.
Definition at line 646 of file XMLElements.cpp.
|
inline |
Check for the existence of a named attribute.
Definition at line 482 of file XMLElements.h.
bool Handle_t::hasAttr | ( | const XmlChar * | t | ) | const |
Check for the existence of a named attribute.
Definition at line 673 of file XMLElements.cpp.
bool Handle_t::hasChild | ( | const XmlChar * | tag | ) | const |
Check the existence of a child with a given tag name.
Definition at line 764 of file XMLElements.cpp.
size_t Handle_t::numChildren | ( | const XmlChar * | tag, |
bool | throw_exception | ||
) | const |
Access the number of children of this DOM element with a given tag name.
Definition at line 695 of file XMLElements.cpp.
|
inline |
Direct access to the XmlElement by dereferencing.
Definition at line 397 of file XMLElements.h.
|
inline |
Direct access to the XmlElement using the operator->
Definition at line 393 of file XMLElements.h.
Handle_t Handle_t::parent | ( | ) | const |
Access the element's parent element.
Definition at line 663 of file XMLElements.cpp.
|
inline |
Direct access to the XmlElement by function.
Definition at line 401 of file XMLElements.h.
const XmlChar * Handle_t::rawTag | ( | ) | const |
Unicode text access to the element's tag. Tis must be wrong ....
Definition at line 631 of file XMLElements.cpp.
const XmlChar * Handle_t::rawText | ( | ) | const |
Unicode text access to the element's text.
Definition at line 636 of file XMLElements.cpp.
const XmlChar * Handle_t::rawValue | ( | ) | const |
Unicode text access to the element's value.
Definition at line 641 of file XMLElements.cpp.
Remove a single child node identified by its handle from the tree of the element.
Definition at line 732 of file XMLElements.cpp.
void Handle_t::removeAttrs | ( | ) | const |
Remove all attributes of this element.
Definition at line 801 of file XMLElements.cpp.
void Handle_t::removeChildren | ( | const XmlChar * | tag | ) | const |
Remove children with a given tag name from the DOM node.
Definition at line 752 of file XMLElements.cpp.
Generic attribute setter with boolen value.
Definition at line 882 of file XMLElements.cpp.
Generic attribute setter with XmlAttr value.
Definition at line 914 of file XMLElements.cpp.
Generic attribute setter with text value.
Definition at line 908 of file XMLElements.cpp.
Generic attribute setter with string value.
Definition at line 903 of file XMLElements.cpp.
Generic attribute setter with unicode value.
Definition at line 919 of file XMLElements.cpp.
Generic attribute setter with double precision floating point value.
Definition at line 896 of file XMLElements.cpp.
Generic attribute setter with floating point value.
Definition at line 889 of file XMLElements.cpp.
Generic attribute setter with integer value.
Definition at line 875 of file XMLElements.cpp.
void Handle_t::setAttrs | ( | Handle_t | e | ) | const |
Set attributes as in argument handle.
Definition at line 823 of file XMLElements.cpp.
Add reference child as a new child node. The obj must have the "name" attribute!
Definition at line 946 of file XMLElements.cpp.
Add reference child as a new child node. The obj must have the "name" attribute!
Definition at line 937 of file XMLElements.cpp.
void Handle_t::setText | ( | const std::string & | text | ) | const |
Set the element's text.
Definition at line 792 of file XMLElements.cpp.
void Handle_t::setText | ( | const XmlChar * | text | ) | const |
Set the element's text.
Definition at line 783 of file XMLElements.cpp.
void Handle_t::setValue | ( | const std::string & | text | ) | const |
Set the element's value.
Definition at line 774 of file XMLElements.cpp.
void Handle_t::setValue | ( | const XmlChar * | text | ) | const |
Set the element's value.
Definition at line 769 of file XMLElements.cpp.
|
inline |
Text access to the element's tag.
Definition at line 414 of file XMLElements.h.
|
inline |
Text access to the element's text.
Definition at line 418 of file XMLElements.h.
|
inline |
Text access to the element's value.
Definition at line 422 of file XMLElements.h.
|
mutable |
The pointer to the XmlElement.
Definition at line 386 of file XMLElements.h.