aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/process.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-18 13:39:44 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-18 13:40:08 +0300
commitf5b479fbabdceda48e3fd20d60bef1af393799cc (patch)
tree5bfffe4ef959f4489c9a7afbe0a4530be0fd20af /include/winapi/process.hpp
parent"return std::move" is evil (diff)
downloadwinapi-common-f5b479fbabdceda48e3fd20d60bef1af393799cc.tar.gz
winapi-common-f5b479fbabdceda48e3fd20d60bef1af393799cc.zip
stream.hpp -> process_io.hpp, move IO there
Diffstat (limited to 'include/winapi/process.hpp')
-rw-r--r--include/winapi/process.hpp45
1 files changed, 2 insertions, 43 deletions
diff --git a/include/winapi/process.hpp b/include/winapi/process.hpp
index 5f841a0..d52ad0a 100644
--- a/include/winapi/process.hpp
+++ b/include/winapi/process.hpp
@@ -7,8 +7,8 @@
#include "cmd_line.hpp"
#include "handle.hpp"
+#include "process_io.hpp"
#include "resource.hpp"
-#include "stream.hpp"
#include <boost/config.hpp>
@@ -21,36 +21,8 @@ namespace winapi {
class Process {
public:
- struct IO {
- IO() = default;
-
- void close();
-
- process::Stdin std_in;
- process::Stdout std_out;
- process::Stderr std_err;
-
- // VS 2013 won't generate these automatically.
-
- IO(IO&& other) BOOST_NOEXCEPT_OR_NOTHROW { swap(other); }
-
- IO& operator=(IO other) BOOST_NOEXCEPT_OR_NOTHROW {
- swap(other);
- return *this;
- }
-
- void swap(IO& other) BOOST_NOEXCEPT_OR_NOTHROW {
- using std::swap;
- swap(std_in, other.std_in);
- swap(std_out, other.std_out);
- swap(std_err, other.std_err);
- }
-
- IO(const IO&) = delete;
- };
-
static Process create(const CommandLine&);
- static Process create(const CommandLine&, IO);
+ static Process create(const CommandLine&, process::IO);
void wait() const;
@@ -69,17 +41,4 @@ private:
Handle m_handle;
};
-inline void swap(Process::IO& a, Process::IO& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
} // namespace winapi
-
-namespace std {
-
-template <>
-inline void swap(winapi::Process::IO& a, winapi::Process::IO& b) BOOST_NOEXCEPT_OR_NOTHROW {
- a.swap(b);
-}
-
-} // namespace std