source: trunk/gsinstaller/fileCopier.h@ 2013

Last change on this file since 2013 was 1766, checked in by cs025, 23 years ago

No true alterations; any differences should be merely whitespace from
debugging.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1#ifndef _FILECOPIER_H_
2#include "file.h"
3#include "filePath.h"
4#include "copyProgress.h"
5#include "diskSpace.h"
6
7class fileCopyMonitor
8{
9public:
10 fileCopyMonitor() {};
11 virtual void copiedFile(string from, string to) = 0;
12 virtual void copiedDir(string dirName) = 0;
13};
14
15class fileCopySet
16{
17private:
18 FileVector fileList;
19 FilePath sourceDir;
20 unsigned long dataSize;
21public:
22 FilePath destDir;
23 fileCopySet();
24 fileCopySet(FileVector files, FilePath &from, FilePath &to);
25 char *destination(File *file);
26 unsigned long getOriginalSize();
27 unsigned long getCopiedSize(DiskSpace &space);
28 bool ensureParent(FilePath &child, fileCopyMonitor *monitor);
29 bool copyFile(File *file, fileCopyMonitor *monitor, copyProgressBar *progressBar);
30 void copy(File *file, fileCopyMonitor *monitor, copyProgressBar *progressBar);
31 void copy(fileCopyMonitor *monitor, copyProgressBar *progressBar);
32};
33
34typedef vector<fileCopySet> fileCopySetList;
35
36class fileCopier
37{
38private:
39 fileCopySetList list;
40 unsigned long dataSize;
41 unsigned long copied;
42 copyProgressBar progressBar;
43 fileCopyMonitor *monitor;
44protected:
45public:
46 fileCopier::fileCopier(fileCopyMonitor *monitor, fileCopySetList &list);
47 fileCopier::fileCopier(fileCopyMonitor *monitor);
48 void fileCopier::addSet(fileCopySet &set) { this->list.push_back(set); }
49 bool checkSpace();
50 void copy();
51};
52#define _FILECOPIER_H_
53#endif
Note: See TracBrowser for help on using the repository browser.