]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/mode.h
Add a helper function for adjusting mode flags
[libs/core.git] / source / io / mode.h
index 706609f03f4bb7c5c8b40c111b1da11f02d4581d..2e7527dc5202d3158895f8c20feb3f90236b17dd 100644 (file)
@@ -25,6 +25,9 @@ inline Mode operator&(Mode m, Mode n)
 inline Mode operator~(Mode m)
 { return Mode(~static_cast<int>(m)); }
 
+inline void adjust_mode(Mode &m, Mode f, bool b)
+{ m = b ? (m|f) : (m&~f); }
+
 
 class invalid_access: public std::logic_error
 {