aboutsummaryrefslogtreecommitdiff
path: root/butl/fdstream.ixx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-07-02 17:21:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-07-07 17:39:46 +0300
commit5b1c20f2315cd7fc624ffd31abdcc03b409bfcb2 (patch)
treec5c7b76dead92292b84586bda1b1256170195c48 /butl/fdstream.ixx
parent15634965e8f0ab753898f5607ba11288556d1235 (diff)
Add cpfile()
Diffstat (limited to 'butl/fdstream.ixx')
-rw-r--r--butl/fdstream.ixx25
1 files changed, 25 insertions, 0 deletions
diff --git a/butl/fdstream.ixx b/butl/fdstream.ixx
new file mode 100644
index 0000000..a3ea83c
--- /dev/null
+++ b/butl/fdstream.ixx
@@ -0,0 +1,25 @@
+// file : butl/fdstream.ixx -*- C++ -*-
+// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+namespace butl
+{
+ inline fdopen_mode operator& (fdopen_mode x, fdopen_mode y) {return x &= y;}
+ inline fdopen_mode operator| (fdopen_mode x, fdopen_mode y) {return x |= y;}
+
+ inline fdopen_mode
+ operator&= (fdopen_mode& x, fdopen_mode y)
+ {
+ return x = static_cast<fdopen_mode> (
+ static_cast<std::uint16_t> (x) &
+ static_cast<std::uint16_t> (y));
+ }
+
+ inline fdopen_mode
+ operator|= (fdopen_mode& x, fdopen_mode y)
+ {
+ return x = static_cast<fdopen_mode> (
+ static_cast<std::uint16_t> (x) |
+ static_cast<std::uint16_t> (y));
+ }
+}