![]() |
Reference documentation for deal.II version 8.4.2
|
#include </build/deal.ii-pdtiAo/deal.ii-8.4.2/contrib/parameter_gui/xml_parameter_reader.h>
Public Member Functions | |
| XMLParameterReader (QTreeWidget *tree_widget) | |
| bool | read_xml_file (QIODevice *device) |
| QString | error_string () const |
Private Member Functions | |
| void | parse_parameters () |
| void | read_subsection_element (QTreeWidgetItem *parent) |
| void | read_parameter_element (QTreeWidgetItem *parent) |
| QString | demangle (const QString &s) |
| QTreeWidgetItem * | create_child_item (QTreeWidgetItem *item) |
Private Attributes | |
| QXmlStreamReader | xml |
| QTreeWidget * | tree_widget |
| QIcon | subsection_icon |
| QIcon | parameter_icon |
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.
Definition at line 44 of file xml_parameter_reader.h.
| dealii::ParameterGui::XMLParameterReader::XMLParameterReader | ( | QTreeWidget * | tree_widget | ) |
Constructor. The parameter values will be stored in tree_widget.
Definition at line 26 of file xml_parameter_reader.cpp.
| bool dealii::ParameterGui::XMLParameterReader::read_xml_file | ( | QIODevice * | device | ) |
This function reads the parameters from device into the tree_widget. We use the QXmlStreamReader class for this. There must be a start element <ParameterHandler> and an end element </ParameterHandler> otherwise an exception is thrown.
Definition at line 39 of file xml_parameter_reader.cpp.
| QString dealii::ParameterGui::XMLParameterReader::error_string | ( | ) | const |
This function returns an error message.
Definition at line 69 of file xml_parameter_reader.cpp.
|
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.
Definition at line 79 of file xml_parameter_reader.cpp.
|
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.
Definition at line 95 of file xml_parameter_reader.cpp.
|
private |
This function parses a parameter and and adds it as a child to parent. A parameter description consists of five elements:
If a parameter description is incomplete, an exception is thrown.
Definition at line 158 of file xml_parameter_reader.cpp.
|
private |
Reimplemented from the ParameterHandler class. Unmangle a string s into its original form.
Definition at line 298 of file xml_parameter_reader.cpp.
|
private |
This helper function creates a new child of item in the tree.
Definition at line 280 of file xml_parameter_reader.cpp.
|
private |
The QXmlStreamReader object for reading XML elements.
Definition at line 109 of file xml_parameter_reader.h.
|
private |
A pointer to the tree structure.
Definition at line 113 of file xml_parameter_reader.h.
|
private |
An icon for subsections in the tree structure.
Definition at line 117 of file xml_parameter_reader.h.
|
private |
An icon for parameters in the tree structure.
Definition at line 121 of file xml_parameter_reader.h.
1.8.12