Fix FreeBSD build.
[haiku.git] / src / tools / restest / OffsetFile.h
blob239a6a7d14e543d15305dde4e10861d6eb495966
1 // OffsetFile.h
3 #ifndef OFFSET_FILE_H
4 #define OFFSET_FILE_H
6 #include <DataIO.h>
7 #include <File.h>
9 class OffsetFile : public BPositionIO {
10 public:
11 OffsetFile();
12 OffsetFile(const BFile& file, off_t offset);
13 virtual ~OffsetFile();
15 status_t SetTo(const BFile& file, off_t offset);
16 void Unset();
17 status_t InitCheck() const;
19 // ssize_t Read(void *buffer, size_t size);
20 // ssize_t Write(const void *buffer, size_t size);
21 ssize_t ReadAt(off_t pos, void *buffer, size_t size);
22 ssize_t WriteAt(off_t pos, const void *buffer,
23 size_t size);
24 off_t Seek(off_t position, uint32 seekMode);
25 off_t Position() const;
26 status_t SetSize(off_t size);
27 status_t GetSize(off_t* size);
29 off_t GetOffset() const;
31 private:
32 BFile fFile;
33 off_t fOffset;
34 off_t fCurrentPosition;
37 #endif // OFFSET_FILE_H