]> git.tdb.fi Git - builder.git/blob - source/copy.h
Create destination path in Copy instead of source path
[builder.git] / source / copy.h
1 #ifndef COPY_H_
2 #define COPY_H_
3
4 #include <msp/core/thread.h>
5 #include <msp/path/path.h>
6 #include "action.h"
7
8 class Package;
9
10 class Copy: public Action
11 {
12 public:
13         Copy(Builder &, const Package &, const Msp::Path::Path &, const Msp::Path::Path &);
14         int check();
15 private:
16         class Worker: public Msp::Thread
17         {
18         public:
19                 Worker(Copy &i): copy(i), done(false), error(false) { launch(); }
20                 bool get_done() const { return done; }
21                 bool get_error() const { return error; }
22         private:
23                 Copy &copy;
24                 bool done;
25                 bool error;
26
27                 void main();
28         };
29
30         Msp::Path::Path src;
31         Msp::Path::Path dest;
32         Worker worker;
33 };
34
35 #endif