All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 #ifndef __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
41 #define __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
42 
43 #include <openfluid/dllexport.hpp>
44 
47 
48 #include <QString>
49 #include <QMap>
50 #include <QDir>
51 #include <QProcess>
52 
53 
54 namespace openfluid { namespace waresdev {
55 
56 
57 class OPENFLUID_API WaresDevPackage: public QObject
58 {
59  Q_OBJECT
60 
61  private slots:
62 
63  void processStandardOutput();
64 
65  void processErrorOutput();
66 
67 
68  protected:
69 
70  static QString m_CMakeCmd;
71 
73 
75 
76  QStringList m_WaresPaths;
77 
78  QString m_Packagers;
79 
81 
82  QString m_PackageName;
83 
85 
87 
88  QString m_ConfFilePath;
89 
90  QProcess* mp_Process = nullptr;
91 
92  WaresDevPackage(const QString& PackageFilePath, const QString& TempSubFolderName);
93 
94  void createAndLauchProcess(const QString& Command);
95 
96 
97  public:
98 
99  virtual ~WaresDevPackage();
100 
101  QStringList getWaresPaths();
102 
103  static bool checkCMakeProgram();
104 
105  QString getPackagers();
106 
107  QString getPackageDescription();
108 
109  QDir getPackageTempDir();
110 
111 
112  signals:
113 
114  void info(const QString& Message);
115 
116  void error(const QString& Message);
117 
118  void finished(bool Ok);
119 
120  void progressed(int Value);
121 };
122 
123 
124 // =====================================================================
125 // =====================================================================
126 
127 
129 {
130  Q_OBJECT
131 
132  private:
133 
134  void writeConfFile();
135 
136  void compress();
137 
138 
139  public:
140 
141  WaresDevExportPackage(const QString& PackageFilePath, const QStringList& WaresPaths,
142  const QString& Packagers, const QString& PackageDescription);
143 
144  public slots:
145 
146  void exportToPackage();
147 };
148 
149 
150 // =====================================================================
151 // =====================================================================
152 
153 
155 {
156  Q_OBJECT
157 
158  private:
159 
160  QStringList m_SelectedWarePaths;
161 
162  void uncompress();
163 
164  void readConfFile();
165 
166 
167  public:
168 
169  WaresDevImportPackage(const QString& PackageFilePath);
170 
171  void setSelectedWares(const QStringList& SelectedWarePaths);
172 
173 
174  public slots:
175 
176  void fetchInformation();
177 
178  void copyWares();
179 };
180 
181 } } // namespaces
182 
183 
184 #endif /* __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__ */
QDir m_PackageTempDir
Definition: WaresDevPackage.hpp:84
QString m_Packagers
Definition: WaresDevPackage.hpp:78
QString m_ConfFilePath
Definition: WaresDevPackage.hpp:88
Definition: WaresDevPackage.hpp:128
static QString m_CMakeCmd
Definition: WaresDevPackage.hpp:70
Header of ...
QString m_TempOfwdpSubDirPath
Definition: WaresDevPackage.hpp:72
Definition: WaresDevPackage.hpp:57
QString m_PackageFilePath
Definition: WaresDevPackage.hpp:74
#define OPENFLUID_API
Definition: dllexport.hpp:87
QString m_PackageTempPath
Definition: WaresDevPackage.hpp:86
QString m_PackageDescription
Definition: WaresDevPackage.hpp:80
QStringList m_WaresPaths
Definition: WaresDevPackage.hpp:76
Definition: WaresDevPackage.hpp:154
QString m_PackageName
Definition: WaresDevPackage.hpp:82