haiku/headers/build/private/storage/FileIO.h
Axel Dörfler 624693f0c8 * Added the BFileIO class to libbe_build.so.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-20 08:13:57 +00:00

47 lines
1.0 KiB
C++

/*
* Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _FILE_IO_H
#define _FILE_IO_H
#include <stdio.h>
#include <DataIO.h>
class BFileIO : public BPositionIO {
public:
BFileIO(FILE* file,
bool takeOverOwnership = false);
virtual ~BFileIO();
virtual ssize_t Read(void *buffer, size_t size);
virtual ssize_t Write(const void *buffer, size_t size);
virtual ssize_t ReadAt(off_t position, void *buffer,
size_t size);
virtual ssize_t WriteAt(off_t position, const void *buffer,
size_t size);
virtual off_t Seek(off_t position, uint32 seekMode);
virtual off_t Position() const;
virtual status_t SetSize(off_t size);
virtual status_t GetSize(off_t* size) const;
private:
BFileIO(const BFileIO& other);
BFileIO& operator=(const BFileIO& other);
off_t _Seek(off_t position, uint32 seekMode) const;
private:
FILE* fFile;
bool fOwnsFile;
};
#endif // _FILE_IO_H