]> git.tdb.fi Git - builder.git/blobdiff - source/copy.h
Move file-to-target mapping to a separate class
[builder.git] / source / copy.h
index bc4c173b140be542a47f35ff91282c7a91e3e9cd..6150fadfefa660c287d8f2a850da098489f51893 100644 (file)
@@ -3,35 +3,36 @@
 
 #include <msp/core/thread.h>
 #include <msp/fs/path.h>
-#include "internalaction.h"
+#include "internaltask.h"
+#include "tool.h"
 
-class Package;
+class Install;
 
 /**
 Copies a file to another place.  Used by the Install target.
 */
-class Copy: public InternalAction
+class Copy: public Tool
 {
 private:
        /**
        A worker thread that actually does the data transfer.
        */
-       class Worker: public InternalAction::Worker
+       class Worker: public InternalTask::Worker
        {
-       public:
-               Worker(Copy &);
        private:
-               Copy &copy;
+               const Install &target;
 
-               void main();
+       public:
+               Worker(const Install &);
+       private:
+               virtual void main();
        };
 
-       Msp::FS::Path src;
-       Msp::FS::Path dest;
-       Msp::FS::Path link;
-
 public:
-       Copy(Builder &, const Package &, const Msp::FS::Path &, const Msp::FS::Path &, const Msp::FS::Path & =Msp::FS::Path());
+       Copy(Builder &);
+
+       virtual Target *create_target(const std::list<Target *> &, const std::string &) const;
+       virtual Task *run(const Target &) const;
 };
 
 #endif