aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-17 19:30:55 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-17 19:30:55 +0300
commit5cb737731a2d516259080522f938d7c54f650e1a (patch)
tree6d2b7672ff7347a942f4cecdde157b72e58eaecb /include
parentecho: read if stdin if no args (diff)
downloadwinapi-common-5cb737731a2d516259080522f938d7c54f650e1a.tar.gz
winapi-common-5cb737731a2d516259080522f938d7c54f650e1a.zip
process_tests: add stdin redirection test
Diffstat (limited to '')
-rw-r--r--include/winapi/handle.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/winapi/handle.hpp b/include/winapi/handle.hpp
index 5f813bc..f6f4c11 100644
--- a/include/winapi/handle.hpp
+++ b/include/winapi/handle.hpp
@@ -13,6 +13,7 @@
#include <cstddef>
#include <memory>
+#include <string>
#include <utility>
namespace winapi {
@@ -46,6 +47,11 @@ public:
void write(const void*, std::size_t nb) const;
void write(const Buffer& buffer) const;
+ template <typename CharT>
+ void write(const std::basic_string<CharT>& src) const {
+ write(src.c_str(), src.size() * sizeof(CharT));
+ }
+
void inherit(bool yes = true) const;
void dont_inherit() const { inherit(false); }