]> git.tdb.fi Git - builder.git/blobdiff - source/tar.h
Refactor InternalTask to take a functor
[builder.git] / source / tar.h
index 137a7ee00969af8bcaa78307e614ee511fa0b63b..fa4a4d6070100098f3da70520caa7efa696cac4f 100644 (file)
@@ -1,45 +1,21 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef TAR_H_
 #define TAR_H_
 
-#include <msp/core/thread.h>
-#include "action.h"
-#include "misc.h"
+#include "tool.h"
 
 class TarBall;
 
-class Tar: public Action
+class Tar: public Tool
 {
 public:
-       Tar(Builder &, const TarBall &);
-       ~Tar();
+       Tar(Builder &);
 
-       virtual int check();
-private:
-       class Worker: public Msp::Thread
-       {
-       public:
-               Worker(Tar &);
-               bool get_done() const { return done; }
-               bool get_error() const { return error; }
-       private:
-               Tar &tar;
-               bool done;
-               bool error;
+       Target *create_target(const std::vector<Target *> &, const std::string &) override;
+       Task *run(const Target &) const override;
 
-               void main();
-               void store_number(char *, unsigned, unsigned);
-       };
-
-       const TarBall &tarball;
-       StringList files;
-       Worker *worker;
+private:
+       static bool _run(const TarBall &);
+       static void store_number(char *, unsigned, unsigned);
 };
 
 #endif