COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coConfigGroup.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef COCONFIGGROUP_H
9 #define COCONFIGGROUP_H
10 
11 #include <QHash>
12 
14 #include <config/coConfigEntry.h>
15 #include <config/coConfigRoot.h>
16 #include <util/coTypes.h>
17 
18 #ifndef CO_gcc3
19 EXPORT_TEMPLATE2(template class CONFIGEXPORT QHash<QString, covise::coConfigRoot *>)
20 #endif
21 
22 namespace covise
23 {
24 
26 {
27 
28 public:
29  coConfigGroup(const QString &groupName);
30  virtual ~coConfigGroup();
31 
32  virtual coConfigEntryStringList getScopeList(const QString &section = 0,
33  const QString &variableName = 0) const;
34  virtual coConfigEntryStringList getVariableList(const QString &section = 0) const;
35 
36  virtual coConfigEntryString getValue(const QString &variable,
37  const QString &section,
38  const QString &defaultValue) const;
39  virtual coConfigEntryString getValue(const QString &variable,
40  const QString &section) const;
41  virtual coConfigEntryString getValue(const QString &simpleVariable) const;
42 
43  virtual const char *getEntry(const char *simpleVariable) const;
44 
45  virtual bool isOn(const QString &variable, const QString &section, bool defaultValue) const;
46  virtual bool isOn(const QString &variable, const QString &section) const;
47  virtual bool isOn(const QString &simpleVariable, bool defaultValue) const;
48  virtual bool isOn(const QString &simpleVariable) const;
49 
50  virtual void setValue(const QString &variable, const QString &value,
51  const QString &section,
52  const QString &configuration = QString::null,
53  const QString &targetHost = QString::null, bool move = false);
54 
55  virtual void setValue(const QString &simpleVariable, const QString &value);
56 
57  virtual bool deleteValue(const QString &variable, const QString &section,
58  const QString &configuration = QString::null,
59  const QString &targetHost = QString::null);
60 
61  virtual bool deleteSection(const QString &section,
62  const QString &configuration = QString::null,
63  const QString &targetHost = QString::null);
64 
65  virtual QStringList getHostnameList() /*const*/;
66  virtual QString getActiveHost() const;
67  virtual bool setActiveHost(const QString &host);
68 
69  virtual const QString &getGroupName() const;
70 
71  virtual void reload();
72  //virtual bool save(const QString & filename, ConfigScope scope = Global) const;
73 
74  virtual coConfigRoot *addConfig(const QString &filename, const QString &name, bool create = false);
75  virtual void removeConfig(const QString &name);
76 
77  virtual bool save(const QString &filename = QString::null) const;
78 
79  void setReadOnly(const QString &config, bool ro);
80  void setReadOnly(bool ro);
81 
82  bool isReadOnly(const QString &config) const;
83  bool isReadOnly() const;
84 
85  virtual coConfigGroup *clone() const;
86  virtual void merge(const coConfigGroup *with);
87  void flatten();
88 
89 private:
91 
92  QString activeHostname;
93  QStringList hostnames;
94  QString groupName;
95 
96  bool readOnly;
97  //friend QHash<QString, coConfigEntry*> mainWindow::loadFile(const QString & fileName);
98  QHash<QString, coConfigRoot *> configs;
99 };
100 }
101 #endif
GLsizei GLsizei GLchar * source
Definition: khronos-glext.h:6739
Definition: coConfigGroup.h:25
GLuint const GLchar * name
Definition: khronos-glext.h:6722
#define CONFIGEXPORT
Definition: coExport.h:337
QStringList hostnames
Definition: coConfigGroup.h:93
QString activeHostname
Definition: coConfigGroup.h:92
#define EXPORT_TEMPLATE2(x, y)
Definition: coExport.h:34
Definition: coConfigRoot.h:29
QString groupName
Definition: coConfigGroup.h:94
bool readOnly
Definition: coConfigGroup.h:96
QHash< QString, coConfigRoot * > configs
Definition: coConfigGroup.h:98
Definition: coConfigEntryString.h:23
GLenum GLenum variable
Definition: khronos-glext.h:9990
Definition: coConfigEntryString.h:53
GLsizei const GLfloat * value
Definition: khronos-glext.h:6760