OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
The XMLParameterWriter class provides an interface to write parameters stored in a QTreeWidget to a file in XML format. More...
#include <xml_parameter_writer.h>
Public Member Functions | |
XMLParameterWriter (QTreeWidget *tree_widget) | |
Constructor. More... | |
bool | write_xml_file (QIODevice *device) |
This function writes the parameter values stored in tree_widget to device in XML format. More... | |
Private Member Functions | |
void | write_item (QTreeWidgetItem *item) |
This function writes a given item of tree_widget to a file in XML format. More... | |
QString | mangle (const QString &s) |
Reimplemented from the ParameterHandler class. More... | |
Private Attributes | |
QXmlStreamWriter | xml |
An QXmlStreamWriter object which implements the functionalities we need for writing parameters to XML files. More... | |
QTreeWidget * | tree_widget |
A pointer to the QTreeWidget structure which stores the parameters. More... | |
The XMLParameterWriter class provides an interface to write parameters stored in a QTreeWidget to a file in XML format.
This class makes extensive use of the QXmlStreamWriter class, which implements the basic functionalities for writing XML files.
dealii::ParameterGui::XMLParameterWriter::XMLParameterWriter | ( | QTreeWidget * | tree_widget | ) |
Constructor.
Parameter values from tree_widget
will be written.
|
private |
Reimplemented from the ParameterHandler class.
Mangle a string s
so that it doesn't contain any special characters or spaces.
|
private |
This function writes a given item
of tree_widget
to a file in XML format.
For this the QXmlStreamWriter class is used. If the item
is a parameter, the elements that describes this parameter are written:
If the item
is a subsection, a start element this_subsection
is written and write_item
is called recursively to write the next item
.
bool dealii::ParameterGui::XMLParameterWriter::write_xml_file | ( | QIODevice * | device | ) |
This function writes the parameter values stored in tree_widget
to device
in XML format.
We use the QXmlStreaWriter class for this. The root element is <ParameterHandler>
|
private |
A pointer to the QTreeWidget structure which stores the parameters.
|
private |
An QXmlStreamWriter object which implements the functionalities we need for writing parameters to XML files.