Code_TYMPAN  4.4.0
Industrial site acoustic simulation
OLocalizator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __O_LOCALIZATOR__
24 #define __O_LOCALIZATOR__
25 
26 #include <QtXml/qdom.h>
27 #include <qmap.h>
28 #include <qstring.h>
29 
30 #include "OXMLTreeManager.h"
31 
39 {
40 public:
45  static bool setRessourceFile(const QString& filename);
50  static void setRessourcePath(const QString& path)
51  {
52  _ressourcePath = path;
53  }
57  static bool isRessourceFile()
58  {
59  return _isRessourceFile;
60  }
66  static QString getString(const QString& classname, const QString& stringId); // translate a string
72  static QString getPicture(const QString& classname, const QString& pictureId); // transtate a picture
73 
77  static QString getResourcePath()
78  {
79  return _ressourcePath;
80  }
81 
82 private:
83  static bool selectClassDirectory(const QString& classname);
84  static bool findIdAndSetValue(const QString& directory, const QString& stringId, QString& returnString);
85 
86 private:
87  static bool _isRessourceFile;
88 
89  typedef QMap<QString, QString> OptimMap;
91  static QString _ressourcePath;
93 };
94 
95 #endif // __O_LOCALIZATOR__
static OptimMap _stringMap
Definition: OLocalizator.h:90
static void setRessourcePath(const QString &path)
Definition: OLocalizator.h:50
static QString getResourcePath()
Definition: OLocalizator.h:77
QMap< QString, QString > OptimMap
Definition: OLocalizator.h:89
static bool isRessourceFile()
Definition: OLocalizator.h:57
static bool _isRessourceFile
Definition: OLocalizator.h:87
static bool setRessourceFile(const QString &filename)
static bool findIdAndSetValue(const QString &directory, const QString &stringId, QString &returnString)
static bool selectClassDirectory(const QString &classname)
static QString _ressourcePath
Definition: OLocalizator.h:91
static QString getPicture(const QString &classname, const QString &pictureId)
static QString getString(const QString &classname, const QString &stringId)
static OXMLTreeManager _treeManager
Definition: OLocalizator.h:92