Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkArchive.h
Go to the documentation of this file.
1 /*============================================================================
2  CMake - Cross Platform Makefile Generator
3  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4 
5  Distributed under the OSI-approved BSD License (the "License");
6  see accompanying file Copyright.txt for details.
7 
8  This software is distributed WITHOUT ANY WARRANTY; without even the
9  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  See the License for more information.
11 ============================================================================*/
12 
13 #ifndef __vtkArchive_h
14 #define __vtkArchive_h
15 
16 // STD includes
17 #include <string>
18 #include <vector>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include "vtkMRMLLogicExport.h"
25 
26 // TODO: this should really be a vtk class that has configuration options
27 // and progress events.
28 
29 VTK_MRML_LOGIC_EXPORT bool list_archive(
30  const char* archiveFileNameFileName,
31  std::vector<std::string>& files);
32 
33 // Warning, it extracts the archive into the current directory
34 // With Qt, you can change the current directory using QDir::setCurrent()
35 VTK_MRML_LOGIC_EXPORT bool extract_tar(const char* tarFileName, bool verbose, bool extract,
36  std::vector<std::string> * extracted_files = 0);
37 
38 // creates a zip file with the full contents of the directory (recurses)
39 // zip entries will include relative path of including tail of directoryToZip
40 VTK_MRML_LOGIC_EXPORT bool zip(const char* zipFileName, const char* directoryToZip);
41 
42 // unzips zip file into specified directory
43 // (internally this supports many formats of archive, not just zip)
44 VTK_MRML_LOGIC_EXPORT bool unzip(const char* zipFileName, const char *destinationDirectory);
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif
VTK_MRML_LOGIC_EXPORT bool zip(const char *zipFileName, const char *directoryToZip)
VTK_MRML_LOGIC_EXPORT bool extract_tar(const char *tarFileName, bool verbose, bool extract, std::vector< std::string > *extracted_files=0)
VTK_MRML_LOGIC_EXPORT bool unzip(const char *zipFileName, const char *destinationDirectory)
VTK_MRML_LOGIC_EXPORT bool list_archive(const char *archiveFileNameFileName, std::vector< std::string > &files)