source: trunk/gsinstaller/fileCopier.h@ 7202

Last change on this file since 7202 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
RevLine 
[1536]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() {};
[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
16class fileCopySet
17{
18private:
[2534]19 FileVector fileList;
20 FilePath sourceDir;
21 string label;
[1536]22 unsigned long dataSize;
[2534]23 unsigned long dataFiles;
[1536]24public:
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
38typedef vector<fileCopySet> fileCopySetList;
39
40class fileCopier
41{
42private:
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;
49protected:
50public:
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.