Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::XmlTagObject Struct Reference

This struct represents a node in the XML parse tree. More...

#include <ogdf/fileformats/XmlParser.h>

Public Member Functions

 XmlTagObject (HashedString *name)
 Constructor. More...
 
 ~XmlTagObject ()
 Destructor; will be performed in destroyParseTree(). More...
 
bool findSonXmlTagObjectByName (const string &sonsName, XmlTagObject *&son) const
 Searches for a son with tag name sonsName. More...
 
bool findSonXmlTagObjectByName (const string &sonsName, List< XmlTagObject *> &sons) const
 Searches for sons with tag name sonsName. More...
 
bool findXmlAttributeObjectByName (const string &attName, XmlAttributeObject *&attribute) const
 Searches for an attribute with name name. More...
 
const int & getDepth () const
 
const int & getLine () const
 
const string & getName () const
 
const string & getValue () const
 
bool hasMoreSonXmlTagObject (const List< string > &sonNamesToIgnore) const
 Searches for sons of father which names are inequal to those in list sonsNames. More...
 
bool isAttributeLess () const
 Checks if currentTag owns at least one attribute. More...
 
bool isLeaf () const
 Checks if currentNode is leaf in the parse tree. More...
 
void setDepth (int newDepth)
 
void setInvalid ()
 
void setLine (int line)
 
void setValid () const
 Setter. More...
 
const bool & valid () const
 Getter. More...
 

Public Attributes

int m_depth
 integer value for the depth in the xml parse tree More...
 
int m_line
 integer value that stores the line number of the tag in the parsed xml document More...
 
XmlTagObject * m_pBrother
 Contains the pointer to a brother tag object or 0 if this object is the only child. More...
 
XmlAttributeObject * m_pFirstAttribute
 Pointer to the first attribute; if there is more than one attribute these are linked by m_pNextAttribute in struct XmlAttributeObject. More...
 
XmlTagObject * m_pFirstSon
 Contains the pointer to the first son tag object, i.e. More...
 
HashedString * m_pTagName
 The identifier of the tag, i.e. More...
 
HashedString * m_pTagValue
 Contains the characters inbetween the start tag and the end tag, i.e. More...
 
bool m_valid
 Flag denotes whether attribute is valid or not. More...
 

Detailed Description

This struct represents a node in the XML parse tree.

Definition at line 104 of file XmlParser.h.

Constructor & Destructor Documentation

◆ XmlTagObject()

ogdf::XmlTagObject::XmlTagObject ( HashedString *  name)
inline

Constructor.

Definition at line 137 of file XmlParser.h.

◆ ~XmlTagObject()

ogdf::XmlTagObject::~XmlTagObject ( )
inline

Destructor; will be performed in destroyParseTree().

Definition at line 147 of file XmlParser.h.

Member Function Documentation

◆ findSonXmlTagObjectByName() [1/2]

bool ogdf::XmlTagObject::findSonXmlTagObjectByName ( const string &  sonsName,
XmlTagObject *&  son 
) const

Searches for a son with tag name sonsName.

Returns the son via the referenced pointer son. Returns true if son is found. Returns false, otherwise, son is set to nullptr.

NEW

◆ findSonXmlTagObjectByName() [2/2]

bool ogdf::XmlTagObject::findSonXmlTagObjectByName ( const string &  sonsName,
List< XmlTagObject *> &  sons 
) const

Searches for sons with tag name sonsName.

Returns the sons via a list with pointers to the sons. Returns true if at least one son was found. Returns false otherwise, sons is set to nullptr.

NEW

◆ findXmlAttributeObjectByName()

bool ogdf::XmlTagObject::findXmlAttributeObjectByName ( const string &  attName,
XmlAttributeObject *&  attribute 
) const

Searches for an attribute with name name.

NEW

◆ getDepth()

const int& ogdf::XmlTagObject::getDepth ( ) const
inline

Definition at line 238 of file XmlParser.h.

◆ getLine()

const int& ogdf::XmlTagObject::getLine ( ) const
inline

Definition at line 249 of file XmlParser.h.

◆ getName()

const string& ogdf::XmlTagObject::getName ( ) const
inline

Definition at line 220 of file XmlParser.h.

◆ getValue()

const string& ogdf::XmlTagObject::getValue ( ) const
inline

Definition at line 224 of file XmlParser.h.

◆ hasMoreSonXmlTagObject()

bool ogdf::XmlTagObject::hasMoreSonXmlTagObject ( const List< string > &  sonNamesToIgnore) const

Searches for sons of father which names are inequal to those in list sonsNames.

Returns true if at least one son of father is found whose name doesn't match one in sonsNames. Returns false otherwise.

NEW

◆ isAttributeLess()

bool ogdf::XmlTagObject::isAttributeLess ( ) const

Checks if currentTag owns at least one attribute.

Returns true if list of attributes isn't empty. Returns false otherwise.

NEW

◆ isLeaf()

bool ogdf::XmlTagObject::isLeaf ( ) const

Checks if currentNode is leaf in the parse tree.

Returns true if list of sons is empty. Returns false otherwise.

NEW

◆ setDepth()

void ogdf::XmlTagObject::setDepth ( int  newDepth)
inline

Definition at line 243 of file XmlParser.h.

◆ setInvalid()

void ogdf::XmlTagObject::setInvalid ( )
inline

Definition at line 233 of file XmlParser.h.

◆ setLine()

void ogdf::XmlTagObject::setLine ( int  line)
inline

Definition at line 254 of file XmlParser.h.

◆ setValid()

void ogdf::XmlTagObject::setValid ( ) const
inline

Setter.

Definition at line 229 of file XmlParser.h.

◆ valid()

const bool& ogdf::XmlTagObject::valid ( ) const
inline

Getter.

Definition at line 216 of file XmlParser.h.

Member Data Documentation

◆ m_depth

int ogdf::XmlTagObject::m_depth

integer value for the depth in the xml parse tree

Definition at line 153 of file XmlParser.h.

◆ m_line

int ogdf::XmlTagObject::m_line

integer value that stores the line number of the tag in the parsed xml document

Definition at line 157 of file XmlParser.h.

◆ m_pBrother

XmlTagObject* ogdf::XmlTagObject::m_pBrother

Contains the pointer to a brother tag object or 0 if this object is the only child.

Definition at line 134 of file XmlParser.h.

◆ m_pFirstAttribute

XmlAttributeObject* ogdf::XmlTagObject::m_pFirstAttribute

Pointer to the first attribute; if there is more than one attribute these are linked by m_pNextAttribute in struct XmlAttributeObject.

Definition at line 115 of file XmlParser.h.

◆ m_pFirstSon

XmlTagObject* ogdf::XmlTagObject::m_pFirstSon

Contains the pointer to the first son tag object, i.e.

for ... ... it contains a pointer to the object representing B The other children of A are reachable via m_pBrother of the first son, i.e. the variable m_pBrother of the object representing B contains a pointer to the object representing C

Definition at line 129 of file XmlParser.h.

◆ m_pTagName

HashedString* ogdf::XmlTagObject::m_pTagName

The identifier of the tag, i.e.

for the identifier is "A"

Definition at line 109 of file XmlParser.h.

◆ m_pTagValue

HashedString* ogdf::XmlTagObject::m_pTagValue

Contains the characters inbetween the start tag and the end tag, i.e.

for lala it contains " lala "

Definition at line 120 of file XmlParser.h.

◆ m_valid

bool ogdf::XmlTagObject::m_valid
mutable

Flag denotes whether attribute is valid or not.

Definition at line 147 of file XmlParser.h.


The documentation for this struct was generated from the following file: