X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.h;h=d65bb05a0c70e62b87382cea20fb16950b8b5061;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=283ef48c5bbfa444b3f52a115562b041d1ca3cb3;hpb=291455f435a4319ce3460e2e47d8f036222a3f92;p=builder.git diff --git a/source/copy.h b/source/copy.h index 283ef48..d65bb05 100644 --- a/source/copy.h +++ b/source/copy.h @@ -1,35 +1,22 @@ #ifndef COPY_H_ #define COPY_H_ -#include -#include -#include "action.h" +#include "tool.h" -class Package; +class InstalledFile; -class Copy: public Action +/** +Copies a file to another place. Used by the InstalledFile target. +*/ +class Copy: public Tool { public: - Copy(Builder &, const Package &, 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; } - bool get_error() const { return error; } - private: - Copy © - bool done; - bool error; + Copy(Builder &); - void main(); - }; + Target *create_target(const std::vector &, const std::string &) override; - Msp::Path::Path src; - Msp::Path::Path dest; - Worker worker; +private: + static bool _run(const InstalledFile &); }; #endif