Manual for OpenFLUID 2.1.11

WaresDevPackage.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30  */
31 
32 
33 /**
34  @file WaresDevPackage.hpp
35  @brief Header of ...
36 
37  @author Aline LIBRES <aline.libres@gmail.com>
38  */
39 
40 
41 #ifndef __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
42 #define __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
43 
44 
45 #include <QString>
46 #include <QMap>
47 #include <QDir>
48 #include <QProcess>
49 
50 #include <openfluid/dllexport.hpp>
54 
55 
56 namespace openfluid { namespace waresdev {
57 
58 
59 class OPENFLUID_API WaresDevPackage: public QObject
60 {
61  Q_OBJECT
62 
63  private slots:
64 
65  void processStandardOutput();
66 
67  void processErrorOutput();
68 
69 
70  protected:
71 
73 
74  QStringList m_WaresPaths;
75 
76  QString m_Packagers;
77 
79 
80  QString m_PackageName;
81 
83 
85 
86  QString m_ConfFilePath;
87 
88  QProcess* mp_Process = nullptr;
89 
90  WaresDevPackage(const QString& PackageFilePath, const QString& TempSubFolderName);
91 
92  void createAndLauchProcess(const openfluid::utils::CMakeProxy::CommandInfos& Command);
93 
94 
95  signals:
96 
97  void info(const QString& Message);
98 
99  void error(const QString& Message);
100 
101  void finished(bool Ok, const QString& Message);
102 
103  void progressed(int Value);
104 
105 
106  public:
107 
108  virtual ~WaresDevPackage();
109 
110  QStringList getWaresPaths();
111 
112  QString getPackagers();
113 
114  QString getPackageDescription();
115 
116  QDir getPackageTempDir();
117 
118 };
119 
120 
121 // =====================================================================
122 // =====================================================================
123 
124 
126 {
127  Q_OBJECT
128 
129  private:
130 
131  void writeConfFile();
132 
133  void compress();
134 
135 
136  public slots:
137 
138  void exportToPackage();
139 
140 
141  public:
142 
143  WaresDevExportPackage(const QString& PackageFilePath, const QStringList& WaresPaths,
144  const QString& Packagers, const QString& PackageDescription);
145 
146 };
147 
148 
149 // =====================================================================
150 // =====================================================================
151 
152 
154 {
155  Q_OBJECT
156 
157  private:
158 
159  QStringList m_SelectedWarePaths;
160 
161  void uncompress();
162 
163  void readConfFile();
164 
165 
166  public slots:
167 
168  void fetchInformation();
169 
170  void copyWares();
171 
172 
173  public:
174 
175  WaresDevImportPackage(const QString& PackageFilePath);
176 
177  void setSelectedWares(const QStringList& SelectedWarePaths);
178 
179 };
180 
181 
182 } } // namespaces
183 
184 
185 #endif /* __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__ */
openfluid::waresdev::WaresDevPackage::m_ConfFilePath
QString m_ConfFilePath
Definition: WaresDevPackage.hpp:86
WareSrcManager.hpp
Header of ...
openfluid::waresdev::WaresDevPackage
Definition: WaresDevPackage.hpp:59
OPENFLUID_API
#define OPENFLUID_API
Definition: dllexport.hpp:86
openfluid::waresdev::WaresDevPackage::m_Packagers
QString m_Packagers
Definition: WaresDevPackage.hpp:76
CMakeProxy.hpp
openfluid::waresdev::WaresDevPackage::m_PackageTempDir
QDir m_PackageTempDir
Definition: WaresDevPackage.hpp:82
openfluid::waresdev::WaresDevImportPackage
Definition: WaresDevPackage.hpp:153
openfluid
Definition: ApplicationException.hpp:47
openfluid::waresdev::WaresDevPackage::m_PackageTempPath
QString m_PackageTempPath
Definition: WaresDevPackage.hpp:84
openfluid::waresdev::WaresDevPackage::m_PackageDescription
QString m_PackageDescription
Definition: WaresDevPackage.hpp:78
dllexport.hpp
openfluid::waresdev::WaresDevPackage::m_PackageName
QString m_PackageName
Definition: WaresDevPackage.hpp:80
openfluid::waresdev::WaresDevPackage::m_WaresPaths
QStringList m_WaresPaths
Definition: WaresDevPackage.hpp:74
openfluid::waresdev::WaresDevExportPackage
Definition: WaresDevPackage.hpp:125
Environment.hpp
openfluid::waresdev::WaresDevPackage::m_PackageFilePath
QString m_PackageFilePath
Definition: WaresDevPackage.hpp:72