diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-18 13:39:44 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-18 13:40:08 +0300 |
commit | f5b479fbabdceda48e3fd20d60bef1af393799cc (patch) | |
tree | 5bfffe4ef959f4489c9a7afbe0a4530be0fd20af /src/stream.cpp | |
parent | "return std::move" is evil (diff) | |
download | winapi-common-f5b479fbabdceda48e3fd20d60bef1af393799cc.tar.gz winapi-common-f5b479fbabdceda48e3fd20d60bef1af393799cc.zip |
stream.hpp -> process_io.hpp, move IO there
Diffstat (limited to '')
-rw-r--r-- | src/stream.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/stream.cpp b/src/stream.cpp deleted file mode 100644 index 76dd5a5..0000000 --- a/src/stream.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com> -// This file is part of the "winapi-common" project. -// For details, see https://github.com/egor-tensin/winapi-common. -// Distributed under the MIT License. - -#include <winapi/file.hpp> -#include <winapi/handle.hpp> -#include <winapi/path.hpp> -#include <winapi/stream.hpp> - -#include <string> -#include <utility> - -namespace winapi { -namespace process { - -Stdin::Stdin() : Stream{Handle::std_in()} {} - -Stdout::Stdout() : Stream{Handle::std_out()} {} - -Stderr::Stderr() : Stream{Handle::std_err()} {} - -Stdin::Stdin(const std::string& path) : Stream{File::open_r(path)} {} - -Stdin::Stdin(const CanonicalPath& path) : Stream{File::open_r(path)} {} - -Stdout::Stdout(const std::string& path) : Stream{File::open_w(path)} {} - -Stdout::Stdout(const CanonicalPath& path) : Stream{File::open_w(path)} {} - -Stderr::Stderr(const std::string& path) : Stream{File::open_w(path)} {} - -Stderr::Stderr(const CanonicalPath& path) : Stream{File::open_w(path)} {} - -Stdin::Stdin(Pipe& pipe) : Stream{std::move(pipe.read_end())} { - pipe.write_end().dont_inherit(); -} - -Stdout::Stdout(Pipe& pipe) : Stream{std::move(pipe.write_end())} { - pipe.read_end().dont_inherit(); -} - -Stderr::Stderr(Pipe& pipe) : Stream{std::move(pipe.write_end())} { - pipe.read_end().dont_inherit(); -} - -} // namespace process -} // namespace winapi |