]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/process.h
Use nullptr instead of 0 for pointers
[libs/core.git] / source / core / process.h
index 5413587cd54f164f38714926a53c445308a02461..0d7faa6c82f96c0e1eb413e582eab6c5a10ff4f4 100644 (file)
@@ -5,6 +5,7 @@
 #include <vector>
 #include <msp/fs/path.h>
 #include <msp/io/base.h>
+#include "noncopyable.h"
 
 namespace Msp {
 
@@ -21,7 +22,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 Process: private NonCopyable
 {
 public:
        typedef std::vector<std::string> Arguments;
@@ -29,20 +30,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();