diff options
Diffstat (limited to '')
-rw-r--r-- | include/winapi/process.hpp | 45 |
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 |