]> git.tdb.fi Git - builder.git/blobdiff - source/externaltask.h
Make wait applicable to all task types
[builder.git] / source / externaltask.h
index 8127c75762459f9a4c73f1c532412a7567c45281..19ffe71e8fa4ff985a9c44805d608de351634cd4 100644 (file)
@@ -45,10 +45,18 @@ public:
        virtual std::string get_command() const;
        virtual void start();
        virtual Status check();
+       virtual Status wait();
+private:
+       Status do_wait(bool);
 
+public:
        void set_stdout(Destination);
        void set_stderr(Destination);
        const std::string &get_output() const { return output; }
+
+       /** Executes a command and captures its output.  Stderr is ignored, but if
+       the command exits with a nonzero status, an exception is thrown. */
+       static std::string run_and_capture_output(const Arguments &, const Msp::FS::Path & = Msp::FS::Path());
 };
 
 #endif