DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Class to easily access the properties of single JsonElements. More...
#include <Elements.h>
Public Types | |
typedef JsonElement * | Elt_t |
Public Member Functions | |
Handle_t (Elt_t e=0) | |
Initializing constructor. More... | |
Elt_t | operator-> () const |
Direct access to the JsonElement using the operator-> More... | |
operator Elt_t () const | |
Direct access to the JsonElement by dereferencing. More... | |
Elt_t | ptr () const |
Direct access to the JsonElement by function. More... | |
const char * | rawTag () const |
Unicode text access to the element's tag. More... | |
const char * | rawText () const |
Unicode text access to the element's text. More... | |
const char * | 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... | |
const char * | attr_name (const Attribute attr) const |
Access attribute name (throws exception if not present) More... | |
const char * | attr_value (const Attribute attr) const |
Access attribute value by the attribute (throws exception if not present) More... | |
const char * | attr_value (const char *attr) const |
Access attribute value by the attribute's unicode name (throws exception if not present) More... | |
const char * | attr_value_nothrow (const char *attr) const |
Access attribute value by the attribute's unicode name (no exception thrown if not present) More... | |
Attribute | attr_ptr (const char *attr) const |
Access attribute pointer by the attribute's unicode name (throws exception if not present) More... | |
Attribute | attr_nothrow (const char *tag) const |
Access attribute pointer by the attribute's unicode name (no exception thrown if not present) More... | |
bool | hasAttr (const char *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 JsonAttr. More... | |
template<class T > | |
T | attr (const char *name) const |
Access typed attribute value by its unicode name. More... | |
bool | hasChild (const char *tag) const |
Check the existence of a child with a given tag name. More... | |
Handle_t | child (const char *tag, bool throw_exception=true) const |
Access a single child by its tag name (unicode) More... | |
NodeList | children (const char *tag) const |
Access a group of children identified by the same tag name. More... | |
size_t | numChildren (const char *tag, bool throw_exception) const |
Access the number of children of this DOM element with a given tag name. More... | |
template<> | |
INLINE Attribute | attr (const char *tag_value) const |
template<> | |
INLINE const char * | attr (const char *tag_value) const |
template<> | |
INLINE bool | attr (const char *tag_value) const |
template<> | |
INLINE int | attr (const char *tag_value) const |
template<> | |
INLINE long | attr (const char *tag_value) const |
template<> | |
INLINE float | attr (const char *tag_value) const |
template<> | |
INLINE double | attr (const char *tag_value) const |
Public Attributes | |
Elt_t | m_node |
The pointer to the JsonElement. More... | |
Class to easily access the properties of single JsonElements.
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 135 of file Elements.h.
typedef JsonElement* dd4hep::json::Handle_t::Elt_t |
Definition at line 138 of file Elements.h.
|
inline |
Initializing constructor.
Definition at line 144 of file Elements.h.
|
inline |
Access typed attribute value by the JsonAttr.
Definition at line 183 of file Elements.h.
T dd4hep::json::Handle_t::attr | ( | const char * | name | ) | const |
Access typed attribute value by its unicode name.
Definition at line 201 of file Elements.h.
INLINE const char* dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 205 of file Elements.h.
INLINE bool dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 209 of file Elements.h.
INLINE int dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 213 of file Elements.h.
INLINE long dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 217 of file Elements.h.
INLINE float dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 221 of file Elements.h.
INLINE double dd4hep::json::Handle_t::attr | ( | const char * | tag_value | ) | const |
Definition at line 225 of file Elements.h.
const char * Handle_t::attr_name | ( | const Attribute | attr | ) | const |
Access attribute name (throws exception if not present)
Definition at line 331 of file Elements.cpp.
Attribute Handle_t::attr_nothrow | ( | const char * | tag | ) | const |
Access attribute pointer by the attribute's unicode name (no exception thrown if not present)
Definition at line 261 of file Elements.cpp.
Attribute Handle_t::attr_ptr | ( | const char * | attr | ) | const |
Access attribute pointer by the attribute's unicode name (throws exception if not present)
Definition at line 318 of file Elements.cpp.
const char * Handle_t::attr_value | ( | const Attribute | attr | ) | const |
Access attribute value by the attribute (throws exception if not present)
Definition at line 344 of file Elements.cpp.
const char * Handle_t::attr_value | ( | const char * | attr | ) | const |
Access attribute value by the attribute's unicode name (throws exception if not present)
Definition at line 339 of file Elements.cpp.
const char * Handle_t::attr_value_nothrow | ( | const char * | attr | ) | const |
Access attribute value by the attribute's unicode name (no exception thrown if not present)
Definition at line 349 of file Elements.cpp.
std::vector< Attribute > Handle_t::attributes | ( | ) | const |
Retrieve a collection of all attributes of this DOM element.
Definition at line 271 of file Elements.cpp.
Handle_t Handle_t::child | ( | const char * | tag, |
bool | throw_exception = true |
||
) | const |
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 297 of file Elements.cpp.
NodeList Handle_t::children | ( | const char * | tag | ) | const |
Access a group of children identified by the same tag name.
Definition at line 309 of file Elements.cpp.
bool Handle_t::hasAttr | ( | const char * | t | ) | const |
Check for the existence of a named attribute.
Definition at line 266 of file Elements.cpp.
bool Handle_t::hasChild | ( | const char * | tag | ) | const |
Check the existence of a child with a given tag name.
Definition at line 313 of file Elements.cpp.
size_t Handle_t::numChildren | ( | const char * | tag, |
bool | throw_exception | ||
) | const |
Access the number of children of this DOM element with a given tag name.
Definition at line 282 of file Elements.cpp.
|
inline |
Direct access to the JsonElement by dereferencing.
Definition at line 148 of file Elements.h.
|
inline |
Direct access to the JsonElement using the operator->
Definition at line 146 of file Elements.h.
|
inline |
Direct access to the JsonElement by function.
Definition at line 150 of file Elements.h.
const char * Handle_t::rawTag | ( | ) | const |
Unicode text access to the element's tag.
Unicode text access to the element's tag. This must be wrong ....
Definition at line 246 of file Elements.cpp.
const char * Handle_t::rawText | ( | ) | const |
Unicode text access to the element's text.
Definition at line 251 of file Elements.cpp.
const char * Handle_t::rawValue | ( | ) | const |
Unicode text access to the element's value.
Definition at line 256 of file Elements.cpp.
|
inline |
Text access to the element's tag.
Definition at line 158 of file Elements.h.
|
inline |
Text access to the element's text.
Definition at line 160 of file Elements.h.
|
inline |
Text access to the element's value.
Definition at line 162 of file Elements.h.
|
mutable |
The pointer to the JsonElement.
Definition at line 141 of file Elements.h.