|
IFEM
90A354
|
Base class for XML based input file parsing. More...
#include <XMLInputBase.h>

Public Member Functions | |
| bool | readXML (const char *fileName, bool verbose=true) |
| Reads an XML input file. More... | |
| bool | loadXML (const char *xml) |
| Loads data from an XML-formatted text string. More... | |
Protected Member Functions | |
| const tinyxml2::XMLElement * | loadFile (tinyxml2::XMLDocument &doc, const char *fileName, bool verbose=false) |
| Loads an XML input file into a tinyxml2::XMLDocument object. More... | |
| virtual bool | parse (const tinyxml2::XMLElement *elem)=0 |
| Parses a data section from an XML element. | |
| virtual const char ** | getPrioritizedTags () const |
| Returns a list of prioritized XML-tags. | |
Private Member Functions | |
| bool | handlePriorityTags (const tinyxml2::XMLElement *base, std::vector< const tinyxml2::XMLElement * > &parsed, bool verbose) |
| Handles the parsing order for certain XML-tags. More... | |
Base class for XML based input file parsing.
This class is inherited by SIMadmin for input parsing handling, and can also be used by applications for pre-parsing of the input file.
|
private |
Handles the parsing order for certain XML-tags.
| [in] | base | The base tag containing the elements to be prioritized |
| [out] | parsed | Vector of XML-elements that was parsed |
| [in] | verbose | If true, print the tags being parsed |
Certain tags need to be parsed before others. This method takes care of this. It is called by the readXML() method in order to read the top level tags in the required order. It can also be called by the application-specific SIM class prior to parsing its data blocks. In that case the getPrioritizedTags() method should be reimplemented by the sub-class to take care of the application-specific tags.
References IFEM::cout, getPrioritizedTags(), parse(), and eig::verbose.
Referenced by readXML().
|
protected |
Loads an XML input file into a tinyxml2::XMLDocument object.
| [out] | doc | The top-level node of the XML-file |
| [in] | fileName | File to read |
| [in] | verbose | If true, print the file(s) being read |
References IFEM::cout, and eig::verbose.
Referenced by SIMinput::readTopologyOnly(), and readXML().
| bool XMLInputBase::loadXML | ( | const char * | xml | ) |
Loads data from an XML-formatted text string.
This method is a convenience offered for unit testing only.
References parse().
| bool XMLInputBase::readXML | ( | const char * | fileName, |
| bool | verbose = true |
||
| ) |
Reads an XML input file.
| [in] | fileName | File to read |
| [in] | verbose | If true, print the tags being parsed |
References IFEM::cout, handlePriorityTags(), loadFile(), parse(), and eig::verbose.
Referenced by SIMadmin::read().