haiku/headers/os/support/MallocIO.h
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00

46 lines
992 B
C++

// MallocIO.h
// Just here to be able to compile and test BResources.
// To be replaced by the OpenBeOS version to be provided by the IK Team.
#ifndef _sk_malloc_io_h
#define _sk_malloc_io_h
#include <DataIO.h>
class BMallocIO : public BPositionIO {
public:
BMallocIO();
virtual ~BMallocIO();
virtual ssize_t ReadAt(off_t pos, void *buffer, size_t size);
virtual ssize_t WriteAt(off_t pos, const void *buffer, size_t size);
virtual off_t Seek(off_t pos, uint32 seekMode);
virtual off_t Position() const;
virtual status_t SetSize(off_t size);
void SetBlockSize(size_t blockSize);
const void *Buffer() const;
size_t BufferLength() const;
private:
status_t _Resize(off_t size);
virtual void _ReservedMallocIO1();
virtual void _ReservedMallocIO2();
BMallocIO(const BMallocIO &);
BMallocIO &operator=(const BMallocIO &);
private:
size_t fBlockSize;
size_t fMallocSize;
size_t fLength;
char *fData;
off_t fPosition;
int32 _reserved[1];
};
#endif // _sk_malloc_io_h