Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkArchive.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3Portions (c) Copyright 2017 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5See COPYRIGHT.txt
6or http://www.slicer.org/copyright/copyright.txt for details.
7
8=========================================================================auto=*/
9
10#ifndef __vtkArchive_h
11#define __vtkArchive_h
12
13// MRML includes
14#include "vtkMRML.h"
15
16// VTK includes
17#include <vtkObject.h>
18
19// STD includes
20#include <string>
21#include <vector>
22
25class VTK_MRML_EXPORT vtkArchive : public vtkObject
26{
27public:
28 static vtkArchive* New();
29 vtkTypeMacro(vtkArchive, vtkObject);
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
32 static bool ListArchive(const char* archiveFileNameFileName, std::vector<std::string>& files);
33
34 // Warning, it extracts the archive into the current directory
35 // With Qt, you can change the current directory using QDir::setCurrent()
36 static bool ExtractTar(const char* tarFileName, bool verbose, bool extract, std::vector<std::string>* extracted_files = nullptr);
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 static 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 static bool UnZip(const char* zipFileName, const char* destinationDirectory);
45
46protected:
48 ~vtkArchive() override;
50 void operator=(const vtkArchive&);
51};
52
53#endif
void PrintSelf(ostream &os, vtkIndent indent) override
void operator=(const vtkArchive &)
vtkArchive(const vtkArchive &)
static bool UnZip(const char *zipFileName, const char *destinationDirectory)
static bool ExtractTar(const char *tarFileName, bool verbose, bool extract, std::vector< std::string > *extracted_files=nullptr)
static bool Zip(const char *zipFileName, const char *directoryToZip)
~vtkArchive() override
static bool ListArchive(const char *archiveFileNameFileName, std::vector< std::string > &files)
static vtkArchive * New()