OpendTect-6_4  6.4
ziputils.h
Go to the documentation of this file.
1 
2 #ifndef ziputils_h
3 #define ziputils_h
4 
5 /*+
6 ________________________________________________________________________
7 
8  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
9  Author: Ranojay Sen
10  Date: December 2011
11  RCS: $Id$
12 ________________________________________________________________________
13 
14 -*/
15 #include "generalmod.h"
16 #include "bufstringset.h"
17 #include "executor.h"
18 #include "ziphandler.h"
19 
20 
26 { mODTextTranslationClass(zipUtils);
27 public:
28  ZipUtils(const char* filelistnm=0);
29  ~ZipUtils();
30 
31  bool Zip(const char* src,const char* dest);
32  bool UnZip(const char* scr, const char* dest);
33  uiString errorMsg() const{ return errmsg_;}
34  void makeFileList(const char* zipfile);
35  const BufferStringSet& getFileList() const { return filelist_; }
36 
37  static bool unZipArchive(const char* src,const char* dest,
38  uiString& errmsg,
39  TaskRunner* tr=0);
40  static bool unZipArchives(const BufferStringSet& archvs,
41  const char* dest,
42  uiString& errmsg,
43  TaskRunner* tr=0);
44  static bool unZipFile(const char* ziparchive,
45  const char* fnm,const char* path,
46  BufferString& errmsg);
47 
48  static bool makeZip(const char* zipfilenm,
49  const BufferStringSet&,
50  uiString& errmsg,
51  TaskRunner* tr=0,
54  static bool makeZip(const char* zipfilenm,
55  const char* tozip,
56  uiString& errmsg,
57  TaskRunner* tr=0,
60  static bool appendToArchive(const char* zipfile,
61  const char* toappend,
62  uiString& errmsg,
63  TaskRunner* tr=0,
66 
67 protected:
68 
69  bool doZip(const char* src,const char* dest);
70  bool doUnZip(const char* src,const char* dest);
71 
76 
77 };
78 
79 
85 mExpClass(General) Zipper : public Executor
87 public:
88  Zipper(const char*,const BufferStringSet&,
90 
91  Zipper(const char*,const char*,
93 
94  uiString uiMessage() const;
95  od_int64 nrDone() const;
96  uiString uiNrDoneText() const;
97  od_int64 totalNr() const;
98  bool isOk() const { return isok_; }
99 
100 protected:
101 
102  int nextStep();
104  int nrdone_;
105  bool isok_;
106 };
107 
108 
115 mExpClass(General) UnZipper : public Executor
117 public:
118  UnZipper(const char*,const char*);
119 
120  uiString uiMessage() const;
121  od_int64 nrDone() const;
122  uiString uiNrDoneText() const;
123  od_int64 totalNr() const;
124  bool isOk() const { return isok_; }
125 
126 protected:
127 
128  int nextStep();
130  int nrdone_;
131  bool isok_;
132 };
133 
134 
135 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Handles zipping and unzipping of files.
Definition: ziphandler.h:53
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
ZipHandler ziphd_
Definition: ziputils.h:103
#define od_int64
Definition: plftypes.h:36
od_int64 nrDone() const
const BufferStringSet & getFileList() const
Definition: ziputils.h:35
BufferString filelistname_
Definition: ziputils.h:74
bool isok_
Definition: ziputils.h:105
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
ZipHandler ziphd_
Definition: ziputils.h:129
uiString errmsg_
Definition: ziputils.h:72
int nextStep()
Zip Utilities.
Definition: ziputils.h:25
Definition: ziphandler.h:61
Class that can execute a task.
Definition: task.h:169
It is an Executor class which uncompresses files of zip format but user should instead use ZipUtils::...
Definition: ziputils.h:115
uiString errorMsg() const
Definition: ziputils.h:33
bool isOk() const
Definition: ziputils.h:98
bool isOk() const
Definition: ziputils.h:124
CompLevel
Definition: ziphandler.h:61
int nrdone_
Definition: ziputils.h:104
mODTextTranslationClass(UnZipper) public uiString uiMessage() const
will be message() again in 7.x
BufferStringSet filelist_
Definition: ziputils.h:73
bool needfilelist_
Definition: ziputils.h:75
It is an Executor class which compresses files into zip format but user should not use it directly in...
Definition: ziputils.h:85
od_int64 totalNr() const
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool isok_
Definition: ziputils.h:131
BufferString errmsg_
Definition: horizontracker.h:119
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
int nrdone_
Definition: ziputils.h:130
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
static uiString tr(const char *text, const char *disambiguation=0, int pluralnr=-1)
Definition: task.h:29

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019