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_ 7 8 9 #include <DataIO.h> 10 11 12 class BDataPositionIOWrapper : public BPositionIO { 13 public: 14 BDataPositionIOWrapper(BDataIO* io); 15 ~BDataPositionIOWrapper(); 16 17 virtual ssize_t Read(void* buffer, size_t size); 18 virtual ssize_t Write(const void* buffer, size_t size); 19 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); 24 25 virtual off_t Seek(off_t position, uint32 seekMode); 26 virtual off_t Position() const; 27 28 virtual status_t SetSize(off_t size); 29 virtual status_t GetSize(off_t* size) const; 30 31 private: 32 BDataIO* fIO; 33 off_t fPosition; 34 }; 35 36 37 #endif // _DATA_POSITION_IO_WRAPPER_H_ 38