Wheefun I/O Library  0.0.5
Useful I/O Primitives.
beos.h
Go to the documentation of this file.
1 /* WFIO - the Wheefun IO Library
2  Copyright (C) 2018 Phillip Kilgore
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17  Additionally, you should have recieved a copy of the GNU Classpath
18  exception, which amends the license to generally permit linking against
19  the software provided herein.
20 */
21 
42 #ifndef WFIO_OS_BEOS_H
43 #define WFIO_OS_BEOS_H
44 
45 #include <wfio/type.h>
46 
47 #if !defined(WFIO_OS_HAIKU) | defined(WFIO_OS_BEOS)
48 #error This file should only be included for BeOS or Haiku platforms.
49 #endif
50 
51 /* Forward declaration of I/O classes */
52 #ifdef __cplusplus
53 class BDataIO;
54 class BPositionIO;
55 class BBufferIO;
56 #else
57 struct BDataIO;
58 struct BPositionIO;
59 struct BBufferIO;
60 #endif
61 
63 
72 WFIO_CXX_DLL struct wfio_device_t* wfio_beos_devFromDataIO(
73  BDataIO* io, int* error);
74 
83 WFIO_CXX_DLL struct wfio_device_t* wfio_beos_devFromPositionIO(
84  BPositionIO* io, int* error);
85 
94 WFIO_CXX_DLL struct wfio_device_t* wfio_beos_devFromBufferIO(
95  BBufferIO* io, int* error);
96 
97 enum wfio_ecode_t;
98 
111 WFIO_CXX_DLL enum wfio_ecode_t wfio_beos_errorFromNative(int ecode);
112 
114 
115 #ifdef __cplusplus
116 
117 #include <wfio/device.h>
118 
119 namespace wfio {
120 namespace os {
121 
126 namespace beos {
133  class BeOSDevice : public wfio::Device {
134  public:
135 
142  BeOSDevice(BDataIO* io, int* error = NULL) : wfio::Device(
143  ::wfio_beos_devFromDataIO(io, error), false) {}
144 
151  BeOSDevice(BPositionIO* io, int* error = NULL) : wfio::Device(
152  ::wfio_beos_devFromPositionIO(io, error), false) {}
153 
160  BeOSDevice(BBufferIO* io, int* error = NULL) : wfio::Device(
161  ::wfio_beos_devFromBufferIO(io, error), false) {}
162  };
163 
164 
168  }
169 }
170 }
171 
177 namespace beos {
178  using namespace wfio::os::beos;
179 }
180 
181 }
182 
183 #endif
184 
185 #endif
The root namespace for WFIO.
Definition: bin.h:879
WFIO_CXX_DLL enum wfio_ecode_t wfio_beos_errorFromNative(int ecode)
Translate a BeOS error code into a WFIO error.
#define WFIO_C_BEGIN
Definition: host.h:477
Elements of WFIO related to BeOS.
Definition: beos.h:126
wfio_ecode_t
The type of an error code provided by WFIO.
Definition: error.h:41
WFIO_CXX_DLL struct wfio_device_t * wfio_beos_devFromBufferIO(BBufferIO *io, int *error)
Open a new device by wrapping a BBufferIO instance.
inline ::wfio_ecode_t errorFromNative(int error)
Translate a BeOS error code into a WFIO error.
Definition: beos.h:166
BeOSDevice(BDataIO *io, int *error=NULL)
Construct a new BEOSDevice from a BDataIO.
Definition: beos.h:142
A C++ wrapper for a wfio_device_t.
Definition: device.h:783
A device wrapping a BeOS IO Object.
Definition: beos.h:133
#define WFIO_C_END
Definition: host.h:485
A simple, byte-oriented channel.
Definition: device.h:164
BeOSDevice(BPositionIO *io, int *error=NULL)
Construct a new BEOSDevice from a BPositionIO.
Definition: beos.h:151
WFIO_CXX_DLL struct wfio_device_t * wfio_beos_devFromPositionIO(BPositionIO *io, int *error)
Open a new device by wrapping a BPositionIO instance.
int ecode
This device&#39;s last error.
Definition: device.h:183
Byte-oriented devices.
BeOSDevice(BBufferIO *io, int *error=NULL)
Construct a new BEOSDevice from a BDataIO.
Definition: beos.h:160
WFIO_C_BEGIN WFIO_CXX_DLL struct wfio_device_t * wfio_beos_devFromDataIO(BDataIO *io, int *error)
Open a new device by wrapping a BDataIO instance.
Shared type definitions.