aboutsummaryrefslogtreecommitdiff
path: root/butl/filesystem.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/filesystem.ixx
parent15634965e8f0ab753898f5607ba11288556d1235 (diff)
Add cpfile()
Diffstat (limited to 'butl/filesystem.ixx')
-rw-r--r--butl/filesystem.ixx18
1 files changed, 18 insertions, 0 deletions
diff --git a/butl/filesystem.ixx b/butl/filesystem.ixx
index 037ab8b..8e81b59 100644
--- a/butl/filesystem.ixx
+++ b/butl/filesystem.ixx
@@ -46,6 +46,24 @@ namespace butl
inline auto_rm<dir_path>::
~auto_rm () {if (!path_.empty ()) try_rmdir_r (path_, true);}
+ // cpflags
+ //
+ inline cpflags operator& (cpflags x, cpflags y) {return x &= y;}
+ inline cpflags operator| (cpflags x, cpflags y) {return x |= y;}
+ inline cpflags operator&= (cpflags& x, cpflags y)
+ {
+ return x = static_cast<cpflags> (
+ static_cast<std::uint16_t> (x) &
+ static_cast<std::uint16_t> (y));
+ }
+
+ inline cpflags operator|= (cpflags& x, cpflags y)
+ {
+ return x = static_cast<cpflags> (
+ static_cast<std::uint16_t> (x) |
+ static_cast<std::uint16_t> (y));
+ }
+
// permissions
//
inline permissions operator& (permissions x, permissions y) {return x &= y;}