OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dealii::ParameterGui::XMLParameterWriter Class Reference

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...
 

Detailed Description

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.

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

Constructor & Destructor Documentation

dealii::ParameterGui::XMLParameterWriter::XMLParameterWriter ( QTreeWidget *  tree_widget)

Constructor.

Parameter values from tree_widget will be written.

Member Function Documentation

QString dealii::ParameterGui::XMLParameterWriter::mangle ( const QString &  s)
private

Reimplemented from the ParameterHandler class.

Mangle a string s so that it doesn't contain any special characters or spaces.

void dealii::ParameterGui::XMLParameterWriter::write_item ( QTreeWidgetItem *  item)
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:

* <value>value</value>
* <default_value>default_value</default_value>
* <documentation>documentation</documentation>
* <pattern>pattern</pattern>
* <pattern_description>[pattern_description]</pattern_description>
*

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>

Member Data Documentation

QTreeWidget* dealii::ParameterGui::XMLParameterWriter::tree_widget
private

A pointer to the QTreeWidget structure which stores the parameters.

QXmlStreamWriter dealii::ParameterGui::XMLParameterWriter::xml
private

An QXmlStreamWriter object which implements the functionalities we need for writing parameters to XML files.


The documentation for this class was generated from the following file: