diff options
Diffstat (limited to 'butl/filesystem.ixx')
-rw-r--r-- | butl/filesystem.ixx | 18 |
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;} |