]> git.tdb.fi Git - libs/core.git/blob - source/io/pipe.h
Have get_user_data_dir return a proper location on Android
[libs/core.git] / source / io / pipe.h
1 #ifndef MSP_IO_PIPE_H_
2 #define MSP_IO_PIPE_H_
3
4 #include "eventobject.h"
5 #include "eventreader.h"
6 #include "handle.h"
7
8 namespace Msp {
9 namespace IO {
10
11 class Pipe: public EventObject
12 {
13 private:
14         Handle read_handle;
15         Handle write_handle;
16         EventReader reader;
17
18 public:
19         Pipe();
20 private:
21         void platform_init();
22 public:
23         ~Pipe();
24
25         void set_mode(Mode);
26         void set_block(bool);
27
28 protected:
29         virtual unsigned do_write(const char *, unsigned);
30         virtual unsigned do_read(char *, unsigned);
31
32 public:
33         virtual const Handle &get_handle(Mode);
34         virtual const Handle &get_event_handle() { return reader.get_event(); }
35 };
36
37 } // namespace IO
38 } // namespace Msp
39
40 #endif