X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.h;h=c0a433996a9c0a14625ebf918c9c6092eac6d9e0;hb=d1eb133ab529cdae131be7b150209f03189248f3;hp=bc4c173b140be542a47f35ff91282c7a91e3e9cd;hpb=f56fa0c68e0eddf1f01c9584b8761431d29e8fa1;p=builder.git diff --git a/source/copy.h b/source/copy.h index bc4c173..c0a4339 100644 --- a/source/copy.h +++ b/source/copy.h @@ -1,37 +1,23 @@ #ifndef COPY_H_ #define COPY_H_ -#include -#include -#include "internalaction.h" +#include "tool.h" -class Package; +class InstalledFile; /** -Copies a file to another place. Used by the Install target. +Copies a file to another place. Used by the InstalledFile target. */ -class Copy: public InternalAction +class Copy: public Tool { -private: - /** - A worker thread that actually does the data transfer. - */ - class Worker: public InternalAction::Worker - { - public: - Worker(Copy &); - private: - Copy © - - void main(); - }; +public: + Copy(Builder &b): Tool(b, "CP") { } - Msp::FS::Path src; - Msp::FS::Path dest; - Msp::FS::Path link; + Target *create_target(const std::vector &, const std::string &) override; + Task *run(const Target &) const override; -public: - Copy(Builder &, const Package &, const Msp::FS::Path &, const Msp::FS::Path &, const Msp::FS::Path & =Msp::FS::Path()); +private: + static bool _run(const InstalledFile &); }; #endif