An XML element using the Qt XML module. More...
#include <QtXmlElement.h>
Public Types | |
typedef std::list< XmlElement * > | NodeList_t |
The type of container used to store XmlElement nodes. | |
Public Member Functions | |
virtual void | appendChild (const XmlNode &child)=0 |
Appends a child element to the element. | |
virtual void | appendChild (const XmlNode &child) |
Appends a child element to the element. | |
virtual bool | attribute (const std::string &name, std::string &value) const |
virtual bool | attribute (const std::string &name, double &value) const |
virtual bool | attribute (const std::string &name, bool &value) const |
virtual bool | attribute (const std::string &name, int &value) const =0 |
Sets value to the attribute name's value. | |
virtual bool | attribute (const std::string &name, unsigned int &value) const =0 |
Sets value to the attribute name's value. | |
virtual bool | attribute (const std::string &name, float &value) const =0 |
Sets value to the attribute name's value. | |
virtual bool | attribute (const std::string &name, double &value) const =0 |
Sets value to the attribute name's value. | |
virtual bool | attribute (const std::string &name, unsigned int &value) const |
virtual bool | attribute (const std::string &name, std::string &value) const =0 |
Sets value to the attribute name's value. | |
virtual bool | attribute (const std::string &name, float &value) const |
virtual bool | attribute (const std::string &name, int &value) const |
virtual bool | attribute (const std::string &name, bool &value) const =0 |
Sets value to the attribute name's value. | |
XmlElement * | create () const |
virtual void | fillNodeList (const std::string &tagName, std::list< XmlElement * > &nodeList) const |
virtual void | fillNodeList (const std::string &tagName, std::list< XmlElement * > &nodeList) const =0 |
Fills the nodeList with elements with tag name tagName. | |
virtual int | getID () const |
virtual int | getID () const =0 |
Returns the ID of the element, if it has one. | |
virtual XmlElement * | getNode (const std::string &tagName) const =0 |
Returns the single direct child element node with name tagName. | |
virtual QtXmlElement * | getNode (const std::string &tagName) const |
virtual const std::string & | getText () const =0 |
Gets the text node from the element. | |
virtual const std::string & | getText () const |
QtXmlElement (const QtXmlElement &) | |
The copy constructor. | |
virtual void | setAttribute (const std::string &name, int value) |
virtual void | setAttribute (const std::string &name, float value)=0 |
Sets attribute named name to the float value value. | |
virtual void | setAttribute (const std::string &name, unsigned int value)=0 |
Sets attribute named name to the unsigned int value value. | |
virtual void | setAttribute (const std::string &name, const std::string &value) |
virtual void | setAttribute (const std::string &name, double value) |
virtual void | setAttribute (const std::string &name, bool value)=0 |
Sets attribute named name to the int value value. | |
virtual void | setAttribute (const std::string &name, double value)=0 |
Sets attribute named name to the double value value. | |
virtual void | setAttribute (const std::string &name, const std::string &value)=0 |
Sets attribute named name to the string value value. | |
virtual void | setAttribute (const std::string &name, unsigned int value) |
virtual void | setAttribute (const std::string &name, float value) |
virtual void | setAttribute (const std::string &name, int value)=0 |
Sets attribute named name to the int value value. | |
virtual void | setAttribute (const std::string &name, bool value) |
virtual std::string | tagName () const =0 |
Returns the tag name of the element. | |
virtual std::string | tagName () const |
virtual | ~QtXmlElement () |
The destructor. | |
Protected Attributes | |
QDomNode | m_node |
The DOM node wrapped by this object. | |
Private Member Functions | |
QtXmlElement (const QDomElement &) | |
A constructor used internally. | |
Private Attributes | |
QDomElement | m_element |
The DOM element node wrapped by this object. | |
Friends | |
class | QtXmlDocument |
An XML element using the Qt XML module.
Definition at line 38 of file QtXmlElement.h.
typedef std::list< XmlElement * > NodeList_t [inherited] |
The type of container used to store XmlElement nodes.
Definition at line 47 of file XmlElement.h.
QtXmlElement | ( | const QDomElement & | element | ) | [private] |
A constructor used internally.
It was only temporarily here to aid in the transition from the old scheme.
Definition at line 46 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QtXmlNode::m_node.
Referenced by QtXmlElement::getNode().
QtXmlElement | ( | const QtXmlElement & | element | ) |
The copy constructor.
Definition at line 25 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QtXmlNode::m_node.
~QtXmlElement | ( | ) | [virtual] |
The destructor.
Definition at line 55 of file QtXmlElement.cxx.
virtual void appendChild | ( | const XmlNode & | child | ) | [pure virtual, inherited] |
Appends a child element to the element.
Implemented in QtXmlNode.
Referenced by XmlController::addDataSource(), XmlController::addViews(), PlotterBaseXML::createAxisModel(), ViewBaseXML::createChild(), PlotterBaseXML::createChildren(), NTupleProjectorXML::createChildren(), DataRepXML::createChildren(), BinsBaseXML::createChildren(), BinningProjectorXML::createChildren(), AxisModelXML::createChildren(), PlotterBaseXML::createCutChildren(), PointRepXML::createElement(), PlotterBaseXML::createFontElement(), PlotterBaseXML::createFontElements(), DataRepXML::createFunctionTargetChild(), and PlotterBaseXML::createTextChildren().
void appendChild | ( | const XmlNode & | child | ) | [virtual, inherited] |
Appends a child element to the element.
Implements XmlNode.
Definition at line 34 of file QtXmlNode.cxx.
References QDomNode::appendChild(), and QtXmlNode::m_node.
bool attribute | ( | const std::string & | name, | |
bool & | value | |||
) | const [virtual] |
Definition at line 204 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toInt().
virtual bool attribute | ( | const std::string & | name, | |
float & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
virtual bool attribute | ( | const std::string & | name, | |
double & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
virtual bool attribute | ( | const std::string & | name, | |
std::string & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
bool attribute | ( | const std::string & | name, | |
double & | value | |||
) | const [virtual] |
Definition at line 252 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toDouble().
virtual bool attribute | ( | const std::string & | name, | |
unsigned int & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
virtual bool attribute | ( | const std::string & | name, | |
int & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
bool attribute | ( | const std::string & | name, | |
std::string & | value | |||
) | const [virtual] |
Definition at line 268 of file QtXmlElement.cxx.
References QDomElement::attribute(), QString::latin1(), and QtXmlElement::m_element.
bool attribute | ( | const std::string & | name, | |
int & | value | |||
) | const [virtual] |
Definition at line 188 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toInt().
bool attribute | ( | const std::string & | name, | |
unsigned int & | value | |||
) | const [virtual] |
Definition at line 220 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toUInt().
virtual bool attribute | ( | const std::string & | name, | |
bool & | value | |||
) | const [pure virtual, inherited] |
Sets value to the attribute name's value.
If attribute of name name exists returns true
, otherwise does not change value and returns false
.
Referenced by DataRepXML::createDataRep(), TransformXML::createObject(), PointRepXML::createObject(), DataRepXML::createObject(), ColorXML::createObject(), BinsBaseXML::createObject(), BinnerAxisXML::createObject(), PlotterBaseXML::createPlotter(), AxisModelXML::getAxis(), FunctionProjectorXML::getFunctionName(), NTupleXML::getName(), HiNTupleXML::getName(), NTupleProjectorXML::getNTupleReference(), ViewBaseXML::getObjects(), AxisModelXML::isLog(), TupleCutXML::setAttributes(), AxisModelXML::setAttributes(), and TupleCutXML::setAxisAttributes().
bool attribute | ( | const std::string & | name, | |
float & | value | |||
) | const [virtual] |
Definition at line 236 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toFloat().
XmlElement* create | ( | ) | const |
void fillNodeList | ( | const std::string & | tagName, | |
std::list< XmlElement * > & | nodeList | |||
) | const [virtual] |
Doesn't hurt us yet.
Definition at line 105 of file QtXmlElement.cxx.
References QDomElement::elementsByTagName(), QtXmlElement::m_element, num_util::size(), and QDomNode::toElement().
virtual void fillNodeList | ( | const std::string & | tagName, | |
std::list< XmlElement * > & | nodeList | |||
) | const [pure virtual, inherited] |
Fills the nodeList with elements with tag name tagName.
Referenced by BaseXML::fillNodeList(), PlotterBaseXML::getCutTargets(), and NTupleXML::getObject().
int getID | ( | ) | const [virtual] |
Definition at line 71 of file QtXmlElement.cxx.
References QDomElement::attribute(), QtXmlElement::m_element, and QString::toInt().
virtual int getID | ( | ) | const [pure virtual, inherited] |
Returns the ID of the element, if it has one.
Referenced by NTupleProjectorXML::createElement(), DataRepXML::createObject(), PlotterBaseXML::getCutTargets(), XmlController::getDataReps(), PlotterBaseXML::getObject(), XmlController::getTupleCuts(), PlotterBaseXML::handleCutPlotter(), PlotterBaseXML::handleFunction(), PlotterBaseXML::handleTextPlotter(), and XmlController::openNTuples().
QtXmlElement * getNode | ( | const std::string & | tagName | ) | const [virtual] |
Definition at line 89 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QtXmlElement::QtXmlElement().
virtual XmlElement* getNode | ( | const std::string & | tagName | ) | const [pure virtual, inherited] |
Returns the single direct child element node with name tagName.
If a child of that name doesn't exist returns a null pointer. if child exists but is not an element node, an assertion is made.
Referenced by DataRepXML::createObject(), BaseXML::getNode(), PlotterBaseXML::handleFunction(), and PlotterBaseXML::handleTextPlotter().
virtual const std::string& getText | ( | ) | const [pure virtual, inherited] |
Gets the text node from the element.
const string & getText | ( | ) | const [virtual] |
Definition at line 283 of file QtXmlElement.cxx.
References QString::latin1(), QtXmlElement::m_element, and QDomElement::text().
virtual void setAttribute | ( | const std::string & | name, | |
double | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the double value value.
virtual void setAttribute | ( | const std::string & | name, | |
const std::string & | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the string value value.
void setAttribute | ( | const std::string & | name, | |
int | value | |||
) | [virtual] |
Definition at line 123 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QDomElement::setAttribute().
Referenced by QtXmlElement::setAttribute().
void setAttribute | ( | const std::string & | name, | |
bool | value | |||
) | [virtual] |
Definition at line 132 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QDomElement::setAttribute().
void setAttribute | ( | const std::string & | name, | |
const std::string & | value | |||
) | [virtual] |
Definition at line 179 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QDomElement::setAttribute().
void setAttribute | ( | const std::string & | name, | |
unsigned int | value | |||
) | [virtual] |
Definition at line 142 of file QtXmlElement.cxx.
References QtXmlElement::m_element, and QDomElement::setAttribute().
void setAttribute | ( | const std::string & | name, | |
double | value | |||
) | [virtual] |
Definition at line 160 of file QtXmlElement.cxx.
References hippodraw::Axes::convert(), QtXmlElement::m_element, and QDomElement::setAttribute().
void setAttribute | ( | const std::string & | name, | |
float | value | |||
) | [virtual] |
Definition at line 150 of file QtXmlElement.cxx.
References QtXmlElement::setAttribute().
virtual void setAttribute | ( | const std::string & | name, | |
float | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the float value value.
virtual void setAttribute | ( | const std::string & | name, | |
int | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the int value value.
virtual void setAttribute | ( | const std::string & | name, | |
bool | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the int value value.
Referenced by NTupleProjectorXML::createChildren(), BinsBaseXML::createChildren(), PlotterBaseXML::createCutChildren(), ViewBaseXML::createElement(), TransformXML::createElement(), PlotterBaseXML::createElement(), NTupleProjectorXML::createElement(), MapMatrixProjectorXML::createElement(), FunctionProjectorXML::createElement(), DataRepXML::createElement(), ColorXML::createElement(), BinsBaseXML::createElement(), DataRepXML::createFunctionTargetChild(), PlotterBaseXML::createTextChildren(), PointRepXML::setAttributes(), FontXML::setAttributes(), BinnerAxisXML::setAttributes(), AxisTickXML::setAttributes(), AxisModelXML::setAttributes(), and BaseXML::setId().
virtual void setAttribute | ( | const std::string & | name, | |
unsigned int | value | |||
) | [pure virtual, inherited] |
Sets attribute named name to the unsigned int value value.
virtual std::string tagName | ( | ) | const [pure virtual, inherited] |
Returns the tag name of the element.
This function is not needed for XML processing. It is only here as an aid in debugging.
string tagName | ( | ) | const [virtual] |
Definition at line 60 of file QtXmlElement.cxx.
References QString::latin1(), QtXmlElement::m_element, and QDomElement::tagName().
friend class QtXmlDocument [friend] |
Reimplemented from QtXmlNode.
Definition at line 56 of file QtXmlElement.h.
QDomElement m_element [private] |
The DOM element node wrapped by this object.
Definition at line 49 of file QtXmlElement.h.
Referenced by QtXmlElement::attribute(), QtXmlElement::fillNodeList(), QtXmlElement::getID(), QtXmlElement::getNode(), QtXmlElement::getText(), QtXmlElement::QtXmlElement(), QtXmlElement::setAttribute(), and QtXmlElement::tagName().
The DOM node wrapped by this object.
Definition at line 41 of file QtXmlNode.h.
Referenced by QtXmlNode::appendChild(), QtXmlDocument::appendChild(), QtXmlElement::QtXmlElement(), and QtXmlTextNode::QtXmlTextNode().