source: pacpusframework/trunk/include/Pacpus/kernel/XmlConfigFile.h@ 3

Last change on this file since 3 was 3, checked in by sgosseli, 12 years ago
  • Add the existing Pacpus files from pacpusdev and pacpuscore.
  • Provide a clean build system based on multiple CMake files.
File size: 2.0 KB
Line 
1/*********************************************************************
2// created: 2006/01/30 - 12:31
3// filename: xmlconfigfile.h
4//
5// author: Gerald Dherbomez
6//
7// purpose: Classe permettant d'enregistrer un fichier de
8// configuration XML
9// Le fichier XML contient 2 sections :
10// - parameters : contient les parametres de l'application
11// - components : contient les composants
12// les composants ne peuvent pas avoir de noeuds fils
13//
14// todo: Creer une dtd qui permet de definir la liste des classes possibles
15// que peuvent prendre les composants
16//
17*********************************************************************/
18
19#ifndef XMLCONFIGFILE_H
20#define XMLCONFIGFILE_H
21
22#include "kernel/pacpus.h"
23#include "XmlComponentConfig.h"
24
25#include <QDomElement>
26#include <QMutex>
27#include <QStringList>
28
29class QFile;
30
31namespace pacpus {
32
33/// XML config properties:
34/// list STRING(S) name(s) of plugin files to be loaded, separated by pipe symbol '|'
35/// e.g. dbt="libDbtPlyGps.so|libDbtPlyVision.so
36class PACPUSLIB_API XmlConfigFile
37{
38 friend XmlComponentConfig::XmlComponentConfig(const QString&);
39 friend class ComponentManager;
40
41public:
42 static XmlConfigFile * create();
43 static void destroy();
44 QDomElement getComponent(QString name);
45 QStringList getAllComponents();
46 QStringList getAllPlugins();
47 int loadFile(QString fileName);
48
49 // not used
50 void saveFile(QString fileName);
51 // not used
52 void addComponent(QDomElement component);
53 // not used
54 void delComponent(QDomElement component);
55
56protected:
57private:
58 XmlConfigFile();
59 ~XmlConfigFile();
60
61 static XmlConfigFile * _xmlConfigFile;
62
63 QDomElement createComponent(QString name);
64
65private:
66 QDomDocument _document;
67 QFile * _file;
68 QMutex _mutex;
69
70 int _numberOfComponents;
71};
72
73} // namespace pacpus
74
75#endif // XMLCONFIGFILE_H
Note: See TracBrowser for help on using the repository browser.