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