]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/process.h
Add move semantics to Variant
[libs/core.git] / source / core / process.h
index 5413587cd54f164f38714926a53c445308a02461..ed997f853e143a52bbfd386cda1e32115c937255 100644 (file)
@@ -5,6 +5,8 @@
 #include <vector>
 #include <msp/fs/path.h>
 #include <msp/io/base.h>
+#include "mspcore_api.h"
+#include "noncopyable.h"
 
 namespace Msp {
 
@@ -21,7 +23,7 @@ the process or capture its output, use an IO::Pipe.  Redirections performed on
 the self object take effect immediately.  It is recommended to perform such
 redirections directly on the Console objects.
 */
-class Process
+class MSPCORE_API Process: private NonCopyable
 {
 public:
        typedef std::vector<std::string> Arguments;
@@ -29,20 +31,19 @@ public:
 private:
        struct Private;
 
-       Private *priv;
+       Private *priv = nullptr;
        FS::Path work_dir;
-       bool redirect;
-       IO::Base *cin;
-       IO::Base *cout;
-       IO::Base *cerr;
-       bool running;
-       bool finished;
-       unsigned exit_code;
+       bool redirect = false;
+       IO::Base *cin = nullptr;
+       IO::Base *cout = nullptr;
+       IO::Base *cerr = nullptr;
+       bool running = false;
+       bool finished = false;
+       unsigned exit_code = 0;
 
        static Process *_self;
 
        Process(const Private &);
-       void init();
 public:
        Process();
        ~Process();