btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / support / DataPositionIOWrapper.h
blob03478e38813d6196d18f146852b9225fa72b7c04
1 /*
2 * Copyright 2014, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _DATA_POSITION_IO_WRAPPER_H_
6 #define _DATA_POSITION_IO_WRAPPER_H_
9 #include <DataIO.h>
12 class BDataPositionIOWrapper : public BPositionIO {
13 public:
14 BDataPositionIOWrapper(BDataIO* io);
15 ~BDataPositionIOWrapper();
17 virtual ssize_t Read(void* buffer, size_t size);
18 virtual ssize_t Write(const void* buffer, size_t size);
20 virtual ssize_t ReadAt(off_t position, void* buffer,
21 size_t size);
22 virtual ssize_t WriteAt(off_t position, const void* buffer,
23 size_t size);
25 virtual off_t Seek(off_t position, uint32 seekMode);
26 virtual off_t Position() const;
28 virtual status_t SetSize(off_t size);
29 virtual status_t GetSize(off_t* size) const;
31 private:
32 BDataIO* fIO;
33 off_t fPosition;
37 #endif // _DATA_POSITION_IO_WRAPPER_H_