xref: /haiku/headers/os/support/DataIO.h (revision 52a380120846174213ccce9c4aab0dda17c72083)
1 // Modified BeOS header. Just here to be able to compile and test BFile.
2 // To be replaced by the OpenBeOS version to be provided by the IK Team.
3 
4 #ifndef __sk_data_io_h__
5 #define __sk_data_io_h__
6 
7 #include <SupportDefs.h>
8 
9 #ifdef USE_OPENBEOS_NAMESPACE
10 namespace OpenBeOS {
11 #endif
12 
13 /*-----------------------------------------------------------------*/
14 /*------- BDataIO Class -------------------------------------------*/
15 
16 class BDataIO {
17 public:
18 					BDataIO();
19 virtual				~BDataIO();
20 
21 virtual	ssize_t		Read(void *buffer, size_t size) = 0;
22 virtual	ssize_t		Write(const void *buffer, size_t size) =0;
23 
24 /*----- Private or reserved ---------------*/
25 private:
26 
27 virtual	void		_ReservedDataIO1();
28 virtual	void		_ReservedDataIO2();
29 virtual	void		_ReservedDataIO3();
30 virtual	void		_ReservedDataIO4();
31 
32 					BDataIO(const BDataIO &);
33 		BDataIO		&operator=(const BDataIO &);
34 
35 		int32		_reserved[2];
36 };
37 
38 /*---------------------------------------------------------------------*/
39 /*------- BPositionIO Class -------------------------------------------*/
40 
41 class BPositionIO : public BDataIO {
42 public:
43 					BPositionIO();
44 virtual				~BPositionIO();
45 
46 virtual	ssize_t		Read(void *buffer, size_t size);
47 virtual	ssize_t		Write(const void *buffer, size_t size);
48 
49 virtual	ssize_t		ReadAt(off_t pos, void *buffer, size_t size) = 0;
50 virtual	ssize_t		WriteAt(off_t pos, const void *buffer, size_t size) = 0;
51 
52 virtual off_t		Seek(off_t position, uint32 seek_mode) = 0;
53 virtual	off_t		Position() const = 0;
54 
55 virtual status_t	SetSize(off_t size);
56 
57 /*----- Private or reserved ---------------*/
58 private:
59 virtual	void		_ReservedPositionIO1();
60 virtual	void		_ReservedPositionIO2();
61 virtual void		_ReservedPositionIO3();
62 virtual void		_ReservedPositionIO4();
63 
64 		int32		_reserved[2];
65 };
66 
67 /*-------------------------------------------------------------*/
68 /*-------------------------------------------------------------*/
69 
70 #ifdef USE_OPENBEOS_NAMESPACE
71 }
72 #endif
73 
74 #endif	// __sk_data_io_h__
75