]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/mode.h
Move files to prepare for assimilation into core
[libs/core.git] / source / io / mode.h
diff --git a/source/io/mode.h b/source/io/mode.h
new file mode 100644 (file)
index 0000000..5e103f2
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef MSP_IO_MODE_H_
+#define MSP_IO_MODE_H_
+
+namespace Msp {
+namespace IO {
+
+enum Mode
+{
+       M_NONE = 0,
+       M_READ = 1,
+       M_WRITE = 2,
+       M_RDWR = M_READ|M_WRITE,
+       M_APPEND = 4,
+       M_NONBLOCK = 8
+};
+
+inline Mode operator|(Mode m, Mode n)
+{ return Mode(static_cast<int>(m)|static_cast<int>(n)); }
+
+inline Mode operator&(Mode m, Mode n)
+{ return Mode(static_cast<int>(m)&static_cast<int>(n)); }
+
+inline Mode operator~(Mode m)
+{ return Mode(~static_cast<int>(m)); }
+
+} // namespace IO
+} // namespace Msp
+
+#endif