The XMLParameterReader class provides an interface to parse parameters from XML files to a QTreeWidget.
More...
#include <xml_parameter_reader.h>
The XMLParameterReader class provides an interface to parse parameters from XML files to a QTreeWidget.
This class makes extensive use of the QXmlStreamReader class, which implements the basic functionalities for parsing XML files.
- Note
- This class is used in the graphical user interface for the ParameterHandler class. It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
- Author
- Martin Steigemann, Wolfgang Bangerth, 2010
dealii::ParameterGui::XMLParameterReader::XMLParameterReader |
( |
QTreeWidget * |
tree_widget | ) |
|
Constructor.
The parameter values will be stored in tree_widget
.
QTreeWidgetItem* dealii::ParameterGui::XMLParameterReader::create_child_item |
( |
QTreeWidgetItem * |
item | ) |
|
|
private |
This helper function creates a new child of item
in the tree.
QString dealii::ParameterGui::XMLParameterReader::demangle |
( |
const QString & |
s | ) |
|
|
private |
Reimplemented from the ParameterHandler class.
Unmangle a string s
into its original form.
QString dealii::ParameterGui::XMLParameterReader::error_string |
( |
| ) |
const |
This function returns an error message.
void dealii::ParameterGui::XMLParameterReader::parse_parameters |
( |
| ) |
|
|
private |
This function implements a loop over the XML file and parses XML elements.
It calls read_subsection_element till the </ParameterHandler>
element is found or the end of the file is reached. In this case, an exception is thrown.
void dealii::ParameterGui::XMLParameterReader::read_parameter_element |
( |
QTreeWidgetItem * |
parent | ) |
|
|
private |
This function parses a parameter
and and adds it as a child to parent
.
A parameter
description consists of five elements:
* <value>value</value>
* <default_value>default_value</default_value>
* <documentation>documentation</documentation>
* <pattern>pattern</pattern>
* <pattern_description>[pattern_description]</pattern_description>
*
If a parameter
description is incomplete, an exception is thrown.
void dealii::ParameterGui::XMLParameterReader::read_subsection_element |
( |
QTreeWidgetItem * |
parent | ) |
|
|
private |
This functions parses a subsection
.
and adds it as a child to parent
. If the next element is <value>
, this functions calls read_parameter_element otherwise the function itself recursively.
bool dealii::ParameterGui::XMLParameterReader::read_xml_file |
( |
QIODevice * |
device | ) |
|
This function reads the parameters from device
into the tree_widget
.
We use the QXmlStreaReader class for this. There must be a start element <ParameterHandler>
and an end element </ParameterHandler>
otherwise an exception is thrown.
QIcon dealii::ParameterGui::XMLParameterReader::parameter_icon |
|
private |
An icon for parameters in the tree structure.
QIcon dealii::ParameterGui::XMLParameterReader::subsection_icon |
|
private |
An icon for subsections in the tree structure.
QTreeWidget* dealii::ParameterGui::XMLParameterReader::tree_widget |
|
private |
A pointer to the tree structure.
QXmlStreamReader dealii::ParameterGui::XMLParameterReader::xml |
|
private |
The QXmlStreamReader object for reading XML elements.
The documentation for this class was generated from the following file: