haiku/headers/os/support/BufferIO.h
Axel Dörfler 087882c26e * Rewrote headers as necessary; only Errors.h and Debug.h still originate from a Be header now;
feel free to change that ;-)
* Cleaned up existing headers.
* Coding style guide update to BBufferIO (renamed m_* members to f*).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-26 16:36:29 +00:00

50 lines
1.2 KiB
C++

/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BUFFER_IO_H
#define _BUFFER_IO_H
#include <DataIO.h>
class BBufferIO : public BPositionIO {
public:
BBufferIO(BPositionIO* stream, size_t bufferSize = 65536L,
bool ownsStream = true);
virtual ~BBufferIO();
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 position, uint32 seekMode);
virtual off_t Position() const;
virtual status_t SetSize(off_t size);
virtual status_t Flush();
BPositionIO* Stream() const;
size_t BufferSize() const;
bool OwnsStream() const;
void SetOwnsStream(bool ownsStream);
void PrintToStream() const;
private:
virtual status_t _Reserved_BufferIO_0(void*);
virtual status_t _Reserved_BufferIO_1(void*);
virtual status_t _Reserved_BufferIO_2(void*);
virtual status_t _Reserved_BufferIO_3(void*);
virtual status_t _Reserved_BufferIO_4(void*);
off_t fBufferStart;
BPositionIO* fStream;
char* fBuffer;
size_t fBufferSize;
size_t fBufferUsed;
uint32 _reserved_ints[6];
bool fBufferIsDirty;
bool fOwnsStream;
bool _reserved_bools[6];
};
#endif // _BUFFER_IO_H