]> git.tdb.fi Git - libs/core.git/blob - source/mode.h
c58ecb0bd55894474b5b828859a7ea9939d5bef0
[libs/core.git] / source / mode.h
1 /* $Id$
2
3 This file is part of libmspio
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7 #ifndef MSP_IO_MODE_H_
8 #define MSP_IO_MODE_H_
9
10 namespace Msp {
11 namespace IO {
12
13 enum Mode
14 {
15         M_NONE=0,
16         M_READ=1,
17         M_WRITE=2,
18         M_RDWR=M_READ|M_WRITE,
19         M_APPEND=4,
20         M_NONBLOCK=8
21 };
22
23 inline Mode operator|(Mode m, Mode n)
24 { return Mode(static_cast<int>(m)|static_cast<int>(n)); }
25
26 inline Mode operator&(Mode m, Mode n)
27 { return Mode(static_cast<int>(m)&static_cast<int>(n)); }
28
29 inline Mode operator~(Mode m)
30 { return Mode(~static_cast<int>(m)); }
31
32 } // namespace IO
33 } // namespace Msp
34
35 #endif