67 : m_pAttributeName(name)
68 , m_pAttributeValue(value)
69 , m_pNextAttribute(nullptr)
78 return m_pAttributeName->
key();
82 return m_pAttributeValue->
key();
139 m_pFirstAttribute(nullptr),
140 m_pTagValue(nullptr),
141 m_pFirstSon(nullptr),
150 mutable bool m_valid;
176 bool findSonXmlTagObjectByName(
const string &sonsName,
186 bool findSonXmlTagObjectByName(
const string &sonsName,
197 bool hasMoreSonXmlTagObject(
const List<string> &sonNamesToIgnore)
const;
203 bool findXmlAttributeObjectByName(
204 const string &attName,
213 bool isAttributeLess()
const;
221 return m_pTagName->
key();
225 return m_pTagValue->
key();
314 m_hashTableInfoIndex = info + 1;
320 bool createParseTree();
345 bool findSonXmlTagObject(
356 bool findBrotherXmlTagObject(
358 int brotherInfoIndex,
367 bool findXmlAttributeObject(
369 int attributeInfoIndex,
380 void printHashTable(ostream &os);
394 void appendAttributeObject(
399 void appendSonTagObject(
414 void printXmlTagObjectTree(
417 int indent = 0)
const;
420 void printSpaces(ostream &os,
int nOfSpaces)
const;
423 const char *functionName,
426 int inputFileLine = -1);
~XmlTagObject()
Destructor; will be performed in destroyParseTree().
Declaration of class GraphAttributes which extends a Graph by additional attributes.
bool m_valid
Flag denotes whether attribute is valid or not (default: invalid).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void setDepth(int newDepth)
int m_recursionDepth
Recursion depth of parse().
Declaration of classes used for hashing.
HashedString * m_pTagName
The identifier of the tag, i.e.
HashedString * m_pAttributeValue
Contains the value assigned to this attribute without qoutes, i.e.
This class scans the characters of the input file and provides the detected token.
int getInputFileLineCounter() const
const string & getValue() const
const int & getLine() const
XmlAttributeObject * m_pNextAttribute
Pointer to the next attribute and 0 if this is the only attribute.
void addNewHashElement(const string &key, int info)
Creates a new hash element and inserts it into the hash table.
ostream & operator<<(ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
~XmlAttributeObject()
Destructor; will be performed in destroyParseTree().
int m_line
integer value that stores the line number of the tag in the parsed xml document
Stack< string > m_tagObserver
stack for checking correctness of correspondent closing tags
const XmlTagObject & getRootTag() const
Allows (non modifying) access to the parse tree.
XmlAttributeObject(HashedString *name, HashedString *value)
Constructor.
HashedString * m_pTagValue
Contains the characters inbetween the start tag and the end tag, i.e.
XmlTagObject * m_pFirstSon
Contains the pointer to the first son tag object, i.e.
XmlAttributeObject * m_pFirstAttribute
Pointer to the first attribute; if there is more than one attribute these are linked by m_pNextAttrib...
const bool & valid() const
Getter.
This struct represents a node in the XML parse tree.
Hashing< string, int > m_hashTable
Hash table for storing names of TagObjects and AttributeObjects in an efficient manner.
Doubly linked lists (maintaining the length of the list).
int getInputFileLineCounter() const
Returns line number of the most recently read line of the input file.
This struct represents an attribute associated to a tag.
const int & getDepth() const
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
void setValid() const
Setter.
XmlTagObject(HashedString *name)
Constructor.
XmlScanner * m_pScanner
Pointer to the scanner.
XmlTagObject * m_pBrother
Contains the pointer to a brother tag object or 0 if this object is the only child.
int m_depth
integer value for the depth in the xml parse tree
HashElement< K, I > * fastInsert(const K &key, const I &info)
Inserts a new element with key key and information info into the hash table.
const string & getName() const
This class parses the XML input file and builds up a parse tree with linked elements XMLTagObject and...
const string & getName() const
Getter.
const string & getValue() const
The namespace for all OGDF objects.
Contains the enum XmlToken and the class XmlScanner.
HashedString * m_pAttributeName
Contains the name of the attribute, i.e.
XmlTagObject * m_pRootTag
Pointer to the root element of the parse tree.
const K & key() const
Returns the key value.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
int m_hashTableInfoIndex
The info element of the hash table is simply an integer number which is incremented for each new elem...
Declaration and implementation of list-based stacks (StackPure<E> and Stack<E>).