X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.h;h=c0a433996a9c0a14625ebf918c9c6092eac6d9e0;hb=d1eb133ab529cdae131be7b150209f03189248f3;hp=e39be16baedeb4793634533030f441761df8019a;hpb=97001ddfa2463e6a3526eff772962acdad45f995;p=builder.git diff --git a/source/copy.h b/source/copy.h index e39be16..c0a4339 100644 --- a/source/copy.h +++ b/source/copy.h @@ -1,31 +1,23 @@ #ifndef COPY_H_ #define COPY_H_ -#include -#include -#include "action.h" +#include "tool.h" -class Copy: public Action +class InstalledFile; + +/** +Copies a file to another place. Used by the InstalledFile target. +*/ +class Copy: public Tool { public: - Copy(Builder &, const Msp::Path::Path &, const Msp::Path::Path &); - int check(); -private: - class Worker: public Msp::Thread - { - public: - Worker(Copy &i): copy(i), done(false) { launch(); } - bool get_done() const { return done; } - private: - Copy © - bool done; + Copy(Builder &b): Tool(b, "CP") { } - void main(); - }; + Target *create_target(const std::vector &, const std::string &) override; + Task *run(const Target &) const override; - Msp::Path::Path src; - Msp::Path::Path dest; - Worker worker; +private: + static bool _run(const InstalledFile &); }; #endif