aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/stream.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-16 18:13:24 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-16 21:20:11 +0300
commit182bff76382d59f44f0ac3c69beb55dacde75eb5 (patch)
treea1a90b748831594eeb14def8eef1c13c98ca5aa6 /src/stream.cpp
parentProcess: add get_exit_code() (diff)
downloadwinapi-common-182bff76382d59f44f0ac3c69beb55dacde75eb5.tar.gz
winapi-common-182bff76382d59f44f0ac3c69beb55dacde75eb5.zip
add path.hpp: CanonicalPath class, etc.
Apparently, relative paths in the Win32 namespace (e.g. \\?\test.txt) are not a thing.
Diffstat (limited to 'src/stream.cpp')
-rw-r--r--src/stream.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stream.cpp b/src/stream.cpp
index b31635e..f9285e6 100644
--- a/src/stream.cpp
+++ b/src/stream.cpp
@@ -5,6 +5,7 @@
#include <winapi/file.hpp>
#include <winapi/handle.hpp>
+#include <winapi/path.hpp>
#include <winapi/stream.hpp>
#include <string>
@@ -21,10 +22,16 @@ Stderr::Stderr() : Stream{Handle::std_err()} {}
Stdin::Stdin(const std::string& path) : Stream{File::open_for_reading(path)} {}
+Stdin::Stdin(const CanonicalPath& path) : Stream{File::open_for_reading(path)} {}
+
Stdout::Stdout(const std::string& path) : Stream{File::open_for_writing(path)} {}
+Stdout::Stdout(const CanonicalPath& path) : Stream{File::open_for_writing(path)} {}
+
Stderr::Stderr(const std::string& path) : Stream{File::open_for_writing(path)} {}
+Stderr::Stderr(const CanonicalPath& path) : Stream{File::open_for_writing(path)} {}
+
Stdin::Stdin(Pipe& pipe) : Stream{std::move(pipe.read_end())} {
pipe.write_end().dont_inherit();
}