]> git.tdb.fi Git - libs/core.git/blob - source/mode.h
5e103f278907be65a1f7f91da38ac34c5d113301
[libs/core.git] / source / mode.h
1 #ifndef MSP_IO_MODE_H_
2 #define MSP_IO_MODE_H_
3
4 namespace Msp {
5 namespace IO {
6
7 enum Mode
8 {
9         M_NONE = 0,
10         M_READ = 1,
11         M_WRITE = 2,
12         M_RDWR = M_READ|M_WRITE,
13         M_APPEND = 4,
14         M_NONBLOCK = 8
15 };
16
17 inline Mode operator|(Mode m, Mode n)
18 { return Mode(static_cast<int>(m)|static_cast<int>(n)); }
19
20 inline Mode operator&(Mode m, Mode n)
21 { return Mode(static_cast<int>(m)&static_cast<int>(n)); }
22
23 inline Mode operator~(Mode m)
24 { return Mode(~static_cast<int>(m)); }
25
26 } // namespace IO
27 } // namespace Msp
28
29 #endif