]> git.tdb.fi Git - libs/core.git/blob - source/io/handle.h
Add move semantics to Variant
[libs/core.git] / source / io / handle.h
1 #ifndef MSP_IO_HANDLE_H_
2 #define MSP_IO_HANDLE_H_
3
4 #include <cstddef>
5
6 namespace Msp {
7 namespace IO {
8
9 class Handle
10 {
11 public:
12         struct Private;
13
14 private:
15         Private *priv = nullptr;
16
17 public:
18         Handle();
19         Handle(const Handle &);
20         Handle &operator=(const Handle &);
21         ~Handle();
22
23         Private &operator*() { return *priv; }
24         const Private &operator*() const { return *priv; }
25
26         explicit operator bool() const;
27 };
28
29
30 void sys_set_blocking(Handle &, bool);
31 void sys_set_inherit(Handle &, bool);
32 std::size_t sys_read(Handle &, char *, std::size_t);
33 std::size_t sys_write(Handle &, const char *, std::size_t);
34 void sys_close(Handle &);
35
36 } // namespace IO
37 } // namespace Msp
38
39 #endif