BOSS 7.1.2
BESIII Offline Software System
|
#include <Dom.h>
Static Public Member Functions | |
static DOMElement * | findFirstChildByName (const DOMElement *parent, const char *const name) |
static DOMElement * | findFirstChildByName (const DOMElement *parent, const std::string name) |
static DOMElement * | getSiblingElement (const DOMNode *child) |
Return next element sibling, if any. | |
static DOMElement * | getFirstChildElement (const DOMNode *parent) |
Get first child which is an element node, if any. | |
static DOMElement * | getElementById (const DOMDocument *doc, const std::string &id) |
static std::string | getNodeName (const DOMNode *elt) |
static std::string | getTagName (const DOMElement *node) |
static bool | checkTagName (const DOMElement *element, const std::string &tagName) |
static void | getChildrenByTagName (const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true) |
static void | getDescendantsByTagName (const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true) |
static void | getAttributeNodeMap (const DOMNode *elt, std::map< std::string, DOMNode * > &atts, bool clear=true) |
static bool | hasAttribute (const DOMNode *elt, const char *attName) |
static std::string | getAttribute (const DOMElement *elt, const char *attName) |
static std::string | getAttribute (const DOMElement *elt, std::string attName) |
static std::string | getAttribute (const DOMNode *elt, const char *attName) |
static std::string | getAttribute (const DOMNode *elt, std::string attName) |
static double | getDoubleAttribute (const DOMNode *elt, std::string attName) |
static unsigned | getDoublesAttribute (const DOMNode *elt, std::string attName, std::vector< double > &values, bool clear=true) |
static unsigned | getFloatsAttribute (const DOMNode *elt, std::string attName, std::vector< float > &values, bool clear=true) |
static int | getIntAttribute (const DOMNode *elt, std::string attName) |
static unsigned | getIntsAttribute (const DOMNode *elt, std::string attName, std::vector< int > &values, bool clear=true) |
static std::string | getText (const DOMNode *textNode) |
static std::string | getTextContent (const DOMElement *elt) |
static void | addAttribute (DOMElement *elt, std::string name, double value) |
Add attribute of type double to a DOM element, DOMString att name. | |
static void | addAttribute (DOMElement *elt, std::string name, int value) |
Add attribute of type int to a DOM element. | |
static void | addAttribute (DOMElement *elt, std::string name, unsigned int value) |
Add attribute of type unsigned int to a DOM element. | |
static void | addAttribute (DOMElement *elt, std::string name, std::string value) |
Add an attribute of type string to a DOM element. | |
static void | addAttribute (DOMElement *elt, std::string name, const char *const value) |
Add an attribute of type char* to a DOM element. | |
static void | printElement (DOMNode *elt, std::ostream &out) |
static void | prettyPrintElement (DOMNode *elt, std::ostream &out, std::string prefix) |
static void | prune (DOMElement *elt) |
This class is just a convenient place for some static functions and a static buffer to be used as temp space for transcoding which beef up the DOM interface a bit
|
static |
Add an attribute of type char*
to a DOM element.
Definition at line 500 of file Dom.cxx.
|
static |
Add attribute of type double to a DOM element, DOMString att name.
Add attribute of type double to a DOM element, std::string att name
Definition at line 392 of file Dom.cxx.
Referenced by addAttribute().
|
static |
Add attribute of type int
to a DOM element.
Definition at line 426 of file Dom.cxx.
|
static |
Add an attribute of type string
to a DOM element.
Definition at line 529 of file Dom.cxx.
|
static |
Add attribute of type unsigned
int
to a DOM element.
Definition at line 464 of file Dom.cxx.
|
static |
See if element has expected tag name or not. Throws NullNode exception if argument is null
Definition at line 146 of file Dom.cxx.
Referenced by XmlBaseCnv::findNextDacCol(), and getChildrenByTagName().
|
static |
Find first child with given tagname. Only immediate children qualify.
parent | Element whose child is to be found |
name | name to look for (may be *, in which case first child, whatever its tagname, will be returned) |
Definition at line 60 of file Dom.cxx.
Referenced by findFirstChildByName(), XmlBaseCnv::findFirstDacCol(), getFirstChildElement(), main(), and prune().
|
static |
Definition at line 88 of file Dom.cxx.
|
static |
Return std::string form of attribute value (standard DOM interface deals only in DOMString type). Return null string if attribute isn't found.
Definition at line 222 of file Dom.cxx.
Referenced by getAttribute(), getAttribute(), getAttribute(), getDoubleAttribute(), getDoublesAttribute(), getFloatsAttribute(), getIntAttribute(), getIntsAttribute(), rdbModel::MysqlConnection::open(), prettyPrintElement(), and printElement().
|
static |
Return std::string form of attribute value (standard DOM interface deals only in DOMString type). Return null string if attribute isn't found.
Definition at line 240 of file Dom.cxx.
|
static |
Return std::string form of attribute value (standard DOM interface deals only in DOMString type) or null if elt is not a DOM_Element or attribute is not found.
Definition at line 246 of file Dom.cxx.
|
static |
Return std::string form of attribute value (standard DOM interface deals only in DOMString type) or null if elt is not a DOM_Element or attribute isn't found
|
static |
Fill supplied map with all attribute nodes, where key is attribute name. By default clear map first.
Definition at line 196 of file Dom.cxx.
Referenced by prettyPrintElement(), and printElement().
|
static |
Fill supplied vector with all (immediate) child elements matching requested tagname. If tagName == "*" returns all immediate children. By default clear vector first.
Definition at line 160 of file Dom.cxx.
|
static |
Fill supplied vector with all descendant elements matching requested tagname. if tagNmae = "*" returns all descendant elements. By default clear vector first.
Definition at line 178 of file Dom.cxx.
|
static |
Return double attribute value. Throw exception if 1) not element node 2) attribute doesn't exist 3) value isn't really a double
Definition at line 263 of file Dom.cxx.
Referenced by main(), and XmlBaseCnv::processValSig().
|
static |
Return doubles in user-supplied vector. Attribute value should be a string consisting of valid ascii representation of floating point numbers, separated by blanks; else the method will throw an exception (xml::WrongAttributeType)
Definition at line 279 of file Dom.cxx.
Referenced by main().
|
static |
|
static |
Get first child which is an element node, if any.
Definition at line 115 of file Dom.cxx.
Referenced by getChildrenByTagName(), and xmlBase::DocMan::parse().
|
static |
Return doubles in user-supplied vector. Attribute value should be a string consisting of valid ascii representation of floating point numbers, separated by blanks; else the method will throw an exception (xml::WrongAttributeType)
Definition at line 302 of file Dom.cxx.
Referenced by XmlBaseCnv::processValSigs().
|
static |
Return int attribute value. Throw exception if 1) not element node 2) attribute doesn't exist 3) value isn't really an int
Definition at line 326 of file Dom.cxx.
Referenced by main().
|
static |
Return ints in user-supplied vector. Attribute value should be a string consisting of valid ascii representation of floating point numbers, separated by blanks; else the method will throw an exception (xml::WrongAttributeType)
Definition at line 342 of file Dom.cxx.
Referenced by main().
|
static |
Create std::string holding node name (if that makes sense for this node). Throws NullNode exception if argument is null
Definition at line 128 of file Dom.cxx.
Referenced by getAttributeNodeMap(), getTagName(), prettyPrintElement(), and printElement().
|
static |
Return next element sibling, if any.
DOM api doesn't provide a direct way to get next sibling which is also an element.
Definition at line 96 of file Dom.cxx.
Referenced by XmlBaseCnv::findNextDacCol(), getChildrenByTagName(), xmlBase::DocMan::parse(), and prune().
|
static |
Create std::string holding tag name (= node name for the base DomNode). Throws NullNode exception if argument is null.
Definition at line 142 of file Dom.cxx.
Referenced by xmlBase::DocMan::parse().
|
static |
Return value of a text node (the text) as a standard string; throw an exception if it's not a text-type node (TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE are ok)
Definition at line 366 of file Dom.cxx.
Referenced by getTextContent(), prettyPrintElement(), and printElement().
|
static |
Return value of text node (the text) for text node which is child of the supplied element argument. Element should have only text content, not mixed content.
Definition at line 385 of file Dom.cxx.
|
static |
Return true if arg is valid element and has specified attribute, else false
Definition at line 210 of file Dom.cxx.
|
static |
(Re)serialize and output a DOM node and its children to the specified stream.
To output an entire document, invoke this routine with the document element as first argument.
This routine works best for DOM representations which do not already include formatting (end-of-lines and indentation).
Definition at line 644 of file Dom.cxx.
Referenced by main(), main(), and prettyPrintElement().
|
static |
(Re)serialize and output a DOM node and its children to the specified stream.
To output an entire document, invoke this routine with the document element as first argument.
This routine works best for DOM representations which already include formatting (end-of-lines and indentation).
Definition at line 570 of file Dom.cxx.
Referenced by main(), and printElement().
|
static |
Utility to remove all children of elt (but not elt itself).
Definition at line 732 of file Dom.cxx.
Referenced by prune().