Last change
on this file since 1548 was 1545, checked in by cs025, 24 years ago |
Improved logging of manifest items, tidied the handling of items with extended
paths in the manifest (logging creation of directories on the path); finally
removed some old garbage from gsinstall.cpp.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.4 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;
|
---|
| 12 | virtual void copiedDir(string dirName) = 0;
|
---|
[1536] | 13 | };
|
---|
| 14 |
|
---|
| 15 | class fileCopySet
|
---|
| 16 | {
|
---|
| 17 | private:
|
---|
| 18 | FileVector fileList;
|
---|
| 19 | FilePath sourceDir;
|
---|
| 20 | unsigned long dataSize;
|
---|
| 21 | public:
|
---|
| 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);
|
---|
[1545] | 28 | bool ensureParent(FilePath &child, fileCopyMonitor *monitor);
|
---|
[1536] | 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 |
|
---|
| 34 | typedef vector<fileCopySet> fileCopySetList;
|
---|
| 35 |
|
---|
| 36 | class fileCopier
|
---|
| 37 | {
|
---|
| 38 | private:
|
---|
| 39 | fileCopySetList list;
|
---|
| 40 | unsigned long dataSize;
|
---|
| 41 | unsigned long copied;
|
---|
| 42 | copyProgressBar progressBar;
|
---|
| 43 | fileCopyMonitor *monitor;
|
---|
| 44 | protected:
|
---|
| 45 | public:
|
---|
| 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.