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