mirror of
https://review.haiku-os.org/haiku
synced 2025-01-24 07:14:48 +01:00
36 lines
657 B
C
36 lines
657 B
C
|
/*
|
||
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||
|
* Distributed under the terms of the MIT License.
|
||
|
*/
|
||
|
#ifndef DATA_OUTPUT_H
|
||
|
#define DATA_OUTPUT_H
|
||
|
|
||
|
|
||
|
#include <SupportDefs.h>
|
||
|
|
||
|
|
||
|
class DataOutput {
|
||
|
public:
|
||
|
virtual ~DataOutput();
|
||
|
|
||
|
virtual status_t WriteData(const void* buffer, size_t size) = 0;
|
||
|
};
|
||
|
|
||
|
|
||
|
class BufferDataOutput : public DataOutput {
|
||
|
public:
|
||
|
BufferDataOutput(void* buffer, size_t size);
|
||
|
|
||
|
size_t BytesWritten() const { return fBytesWritten; }
|
||
|
|
||
|
virtual status_t WriteData(const void* buffer, size_t size);
|
||
|
|
||
|
private:
|
||
|
void* fBuffer;
|
||
|
size_t fSize;
|
||
|
size_t fBytesWritten;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif // DATA_OUTPUT_H
|