]> git.tdb.fi Git - builder.git/blobdiff - source/sourcegenerator.h
Refactor the use of external tasks in tools
[builder.git] / source / sourcegenerator.h
index be7d675fe8027aee3bb8a6a9c96c221e07325235..b8dee24acfd8796de62900df56b5975261f98876 100644 (file)
@@ -6,6 +6,8 @@
 #include "sourcepackage.h"
 #include "tool.h"
 
+class SourceFile;
+
 class SourceGenerator: public Tool
 {
 public:
@@ -16,23 +18,27 @@ public:
 
        private:
                void argument(const std::string &);
+               void arguments(const std::vector<std::string> &);
                void command(const std::string &);
                void in_suffix(const std::string &);
+               void out_argument(const std::string &);
                void out_suffix(const std::string &);
        };
 
 private:
        const SourcePackage &package;
-       std::list<std::string> out_suffixes;
-       std::list<std::string> arguments;
+       std::vector<std::string> out_suffixes;
+       std::vector<std::string> arguments;
+       std::string out_argument;
 
 public:
        SourceGenerator(Builder &, const SourcePackage &, const std::string &);
 
-       virtual Target *create_source(const Component &, const Msp::FS::Path &) const;
-       virtual Target *create_target(const std::list<Target *> &, const std::string &);
+       Target *create_source(const Component &, const Msp::FS::Path &) const override;
+       Target *create_target(const std::vector<Target *> &, const std::string &) override;
 
-       virtual Task *run(const Target &) const;
+private:
+       static ExternalTask::Arguments _run(const SourceFile &, Msp::FS::Path &);
 };
 
 #endif