Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
ZIPFacade.h
1/*
2 *
3 * This file is part of Tulip (https://tulip.labri.fr)
4 *
5 * Authors: David Auber and the Tulip development Team
6 * from LaBRI, University of Bordeaux
7 *
8 * Tulip is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3
11 * of the License, or (at your option) any later version.
12 *
13 * Tulip is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
17 *
18 */
19///@cond DOXYGEN_HIDDEN
20
21#ifndef ZIPFACADE_H
22#define ZIPFACADE_H
23
24#include <tulip/tulipconf.h>
25
26namespace tlp {
27class PluginProgress;
28}
29
30class QString;
31
32/**
33 @brief This class is a facade to the QuaZIP libraries features.
34 It provides convenience methods allowing to manipulate the QuaZIP library on a higher level.
35 QuaZIPFacade contains only static methods, as it should only be used as a toolbox.
36 */
37class TLP_QT_SCOPE ZIPFacade {
38
39public:
40 /**
41 @brief Compress (ZIPs) a directory into an archive.
42 This method compress the content of a directory (without taking the top directory) into an
43 archive.
44 @param rootPath The absolute path of the directory to compress.
45 @param archivePath The absolute file path of the ZIP file to create.
46 @param progress A progress handler
47 @warning If an archive already exists with that name, it will be overwritten.
48 @return true if compression process went successfully
49 */
50 static bool zipDir(const QString &rootPath, const QString &archivePath,
51 tlp::PluginProgress *progress = nullptr);
52
53 /**
54 @brief Uncompress (un-ZIPs) an archive into a directory.
55 Files contained in the archive will be stored inside the specified directory. Making it the root
56 path of the uncompressed files.
57 @param rootPath The absolute path of the directory where files should be written.
58 @param archivePath The absolute file path of the ZIP file to uncompress.
59 @param progress A progress handler
60 @warning If some files already exist in the target directory, they will be overwritten.
61 @return true if uncompression process went successfully
62 */
63 static bool unzip(const QString &rootPath, const QString &archivePath,
64 tlp::PluginProgress *progress = nullptr);
65};
66
67#endif // ZIPFACADE_H
68///@endcond
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...