]> git.tdb.fi Git - builder.git/blob - source/copy.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / copy.h
1 #ifndef COPY_H_
2 #define COPY_H_
3
4 #include <msp/core/thread.h>
5 #include <msp/fs/path.h>
6 #include "internaltask.h"
7 #include "tool.h"
8
9 class InstalledFile;
10
11 /**
12 Copies a file to another place.  Used by the InstalledFile target.
13 */
14 class Copy: public Tool
15 {
16 private:
17         /**
18         A worker thread that actually does the data transfer.
19         */
20         class Worker: public InternalTask::Worker
21         {
22         private:
23                 const InstalledFile &target;
24
25         public:
26                 Worker(const InstalledFile &);
27         private:
28                 virtual void main();
29         };
30
31 public:
32         Copy(Builder &);
33
34         virtual Target *create_target(const std::list<Target *> &, const std::string &);
35         virtual Task *run(const Target &) const;
36 };
37
38 #endif