![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 #ifndef QUAZIPFACADE_H 00022 #define QUAZIPFACADE_H 00023 00024 #include <tulip/tulipconf.h> 00025 00026 namespace tlp { 00027 class PluginProgress; 00028 } 00029 00030 class QString; 00031 00032 /** 00033 @brief This class is a facade to the QuaZIP libraries features. 00034 It provides with convenience methods allowing to manipulate the QuaZIP library on a higher level. 00035 QuaZIPFacade contains only static methods, as it should only work as a toolbox. 00036 */ 00037 class TLP_QT_SCOPE QuaZIPFacade { 00038 QuaZIPFacade(); 00039 public: 00040 00041 /** 00042 @brief Compress (ZIPs) a directory into an archive. 00043 This method compress the content of a directory (without taking the top directory) into an archive. 00044 @param rootPath The absolute path of the directory to compress. 00045 @param archivePath The absolute file path of the ZIP file to create. 00046 @param progress A progress handler 00047 @warning If an archive already exists with that name, it will be overwritten. 00048 @return true if compression process went sucessfuly 00049 */ 00050 static bool zipDir(const QString &rootPath, const QString &archivePath, tlp::PluginProgress *progress=NULL); 00051 00052 /** 00053 @brief Uncompress (un-ZIPs) an archive into a directory. 00054 Files contained in the archive will be stored inside the specified directory. Making it the root path of the uncompressed files. 00055 @param rootPath The absolute path of the directory where files should be written. 00056 @param archivePath The absolute file path of the ZIP file to uncompress. 00057 @param progress A progress handler 00058 @warning If some files already exist in the target directory, they will be overwritten. 00059 @return true if uncompression process went sucessfuly 00060 */ 00061 static bool unzip(const QString &rootPath, const QString &archivePath, tlp::PluginProgress *progress=NULL); 00062 }; 00063 00064 #endif // QUAZIPFACADE_H 00065 ///@endcond