From 5b1c20f2315cd7fc624ffd31abdcc03b409bfcb2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 2 Jul 2016 17:21:54 +0300 Subject: Add cpfile() --- butl/filesystem.ixx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'butl/filesystem.ixx') 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:: ~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 ( + static_cast (x) & + static_cast (y)); + } + + inline cpflags operator|= (cpflags& x, cpflags y) + { + return x = static_cast ( + static_cast (x) | + static_cast (y)); + } + // permissions // inline permissions operator& (permissions x, permissions y) {return x &= y;} -- cgit v1.1