2 * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _FILE_DESCRIPTOR_IO_H
6 #define _FILE_DESCRIPTOR_IO_H
12 class BFileDescriptorIO
: public BPositionIO
{
14 BFileDescriptorIO(int fd
,
15 bool takeOverOwnership
= false);
16 virtual ~BFileDescriptorIO();
18 virtual ssize_t
Read(void *buffer
, size_t size
);
19 virtual ssize_t
Write(const void *buffer
, size_t size
);
21 virtual ssize_t
ReadAt(off_t position
, void *buffer
,
23 virtual ssize_t
WriteAt(off_t position
, const void *buffer
,
26 virtual off_t
Seek(off_t position
, uint32 seekMode
);
27 virtual off_t
Position() const;
29 virtual status_t
SetSize(off_t size
);
30 virtual status_t
GetSize(off_t
* size
) const;
34 const BFileDescriptorIO
& other
);
35 BFileDescriptorIO
& operator=(const BFileDescriptorIO
& other
);
43 #endif // _FILE_DESCRIPTOR_IO_H