source: pacpusframework/branches/0.0.x/include/Pacpus/kernel/XmlConfigFile.h

Last change on this file was 116, checked in by Marek Kurdej, 11 years ago

Added: PacpusException - base class for all exceptions. DbiteExceptions inherits from it.
Added: PacpusLibConfig.h - dllimport/dllexport clauses separated from pacpus.h.
Update: comments.

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @file
6/// @author Gerald Dherbomez <firstname.surname@utc.fr>
7/// @date January, 2006
8/// @version $Id: XmlConfigFile.h 116 2013-06-25 11:44:25Z kurdejma $
9/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
10/// @brief Brief description.
11///
12/// Purpose: Class that manages the XML file. This file is used to configure permettant d'enregistrer un fichier de
13/// a PACPUS application.
14/// The XML file includes 2 sections :
15/// - parameters : parameters of the application
16/// - components : a list of components to load
17
18#ifndef DEF_PACPUS_XMLCONFIGFILE_H
19#define DEF_PACPUS_XMLCONFIGFILE_H
20
21#include <Pacpus/kernel/PacpusLibConfig.h>
22#include <Pacpus/kernel/XmlComponentConfig.h>
23
24#include <QDomElement>
25#include <QMutex>
26#include <QStringList>
27
28class QFile;
29
30namespace pacpus {
31
32/// XML config properties:
33/// list STRING(S) name(s) of plugin files to be loaded, separated by pipe symbol '|'
34/// e.g. dbt="libDbtPlyGps.so|libDbtPlyVision.so
35class PACPUSLIB_API XmlConfigFile
36{
37 friend XmlComponentConfig::XmlComponentConfig(const QString&);
38 friend class ComponentManager;
39
40public:
41 /// @todo Documentation
42 static XmlConfigFile * create();
43 /// @todo Documentation
44 static void destroy();
45 /// @todo Documentation
46 QDomElement getComponent(QString name);
47 /// @returns a list of all names of components declared in the XML tree
48 QStringList getAllComponents();
49 /// @todo Documentation
50 QStringList getAllPlugins();
51 /// @todo Documentation
52 int loadFile(QString fileName);
53
54 /// @todo Documentation
55 /// not used
56 void saveFile(QString fileName);
57 /// @todo Documentation
58 /// not used
59 void addComponent(QDomElement component);
60 /// @todo Documentation
61 /// not used
62 void delComponent(QDomElement component);
63
64protected:
65private:
66 XmlConfigFile();
67 ~XmlConfigFile();
68
69 static XmlConfigFile * _xmlConfigFile;
70
71 QDomElement createComponent(QString name);
72
73private:
74 QDomDocument _document;
75 QFile * _file;
76 QMutex _mutex;
77
78 int _numberOfComponents;
79};
80
81} // namespace pacpus
82
83#endif // DEF_PACPUS_XMLCONFIGFILE_H
Note: See TracBrowser for help on using the repository browser.