OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xml_parameter_reader.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 // $Id: xml_parameter_reader.h 2226 2014-04-04 21:21:00Z secanell $
3 //
4 // Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 
18 #ifndef XMLPARAMETERREADER_H
19 #define XMLPARAMETERREADER_H
20 
21 #include <QIcon>
22 #include <QXmlStreamReader>
23 #include <QTreeWidget>
24 #include <QTreeWidgetItem>
25 
26 
27 namespace dealii
28 {
32  namespace ParameterGui
33  {
46  {
47  public:
52  XMLParameterReader (QTreeWidget *tree_widget);
61  bool read_xml_file (QIODevice *device);
65  QString error_string () const;
66 
67  private:
74  void parse_parameters ();
82  void read_subsection_element (QTreeWidgetItem *parent);
97  void read_parameter_element (QTreeWidgetItem *parent);
102  QString demangle (const QString &s);
106  QTreeWidgetItem * create_child_item(QTreeWidgetItem *item);
110  QXmlStreamReader xml;
114  QTreeWidget * tree_widget;
123  };
124  }
126 }
127 
128 
129 #endif
XMLParameterReader(QTreeWidget *tree_widget)
Constructor.
QIcon parameter_icon
An icon for parameters in the tree structure.
Definition: xml_parameter_reader.h:122
QIcon subsection_icon
An icon for subsections in the tree structure.
Definition: xml_parameter_reader.h:118
QXmlStreamReader xml
The QXmlStreamReader object for reading XML elements.
Definition: xml_parameter_reader.h:110
bool read_xml_file(QIODevice *device)
This function reads the parameters from device into the tree_widget.
QString demangle(const QString &s)
Reimplemented from the ParameterHandler class.
void parse_parameters()
This function implements a loop over the XML file and parses XML elements.
void read_parameter_element(QTreeWidgetItem *parent)
This function parses a parameter and and adds it as a child to parent.
QTreeWidget * tree_widget
A pointer to the tree structure.
Definition: xml_parameter_reader.h:114
QString error_string() const
This function returns an error message.
The XMLParameterReader class provides an interface to parse parameters from XML files to a QTreeWidge...
Definition: xml_parameter_reader.h:45
void read_subsection_element(QTreeWidgetItem *parent)
This functions parses a subsection.
QTreeWidgetItem * create_child_item(QTreeWidgetItem *item)
This helper function creates a new child of item in the tree.