xref: /haiku/src/system/boot/platform/atari_m68k/Handle.h (revision e1c4049fed1047bdb957b0529e1921e97ef94770)
1 /*
2  * Copyright 2008-2010, François Revol, revol@free.fr. All rights reserved.
3  * Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef HANDLE_H
7 #define HANDLE_H
8 
9 
10 #include <boot/vfs.h>
11 
12 
13 #ifdef __cplusplus
14 
15 class Handle : public Node {
16 	public:
17 		Handle(int handle);
18 		Handle();
19 		virtual ~Handle();
20 
21 		void SetHandle(int handle);
22 
23 		virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize);
24 		virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize);
25 
26 		virtual off_t Size() const;
27 
28 	protected:
29 		int16		fHandle;
30 };
31 
32 /* block devices */
33 /* cf. devices.cpp */
34 
35 #endif	/* __cplusplus */
36 
37 #endif	/* HANDLE_H */
38