2009-11-15 21:29:53 +00:00
|
|
|
/*
|
2011-01-30 15:15:33 +00:00
|
|
|
* Copyright 2009,2011, Haiku, Inc.
|
2009-11-15 21:29:53 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-30 15:05:38 +00:00
|
|
|
#ifndef _PACKAGE__HPKG__DATA_OUTPUT_H_
|
|
|
|
#define _PACKAGE__HPKG__DATA_OUTPUT_H_
|
2009-11-15 21:29:53 +00:00
|
|
|
|
|
|
|
|
2014-02-10 18:21:50 +01:00
|
|
|
#include <DataIO.h>
|
2009-11-15 21:29:53 +00:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
2011-01-27 23:17:03 +00:00
|
|
|
namespace BPackageKit {
|
|
|
|
|
2011-01-30 15:05:38 +00:00
|
|
|
namespace BHPKG {
|
2011-01-27 23:17:03 +00:00
|
|
|
|
|
|
|
|
2014-02-10 18:21:50 +01:00
|
|
|
class BBufferDataOutput : public BDataIO {
|
2009-11-15 21:29:53 +00:00
|
|
|
public:
|
2011-01-30 15:05:38 +00:00
|
|
|
BBufferDataOutput(void* buffer, size_t size);
|
2009-11-15 21:29:53 +00:00
|
|
|
|
|
|
|
size_t BytesWritten() const { return fBytesWritten; }
|
|
|
|
|
2014-02-10 18:21:50 +01:00
|
|
|
virtual status_t Write(const void* buffer, size_t size);
|
|
|
|
virtual ssize_t Read(void* buffer, size_t size)
|
|
|
|
{ return B_NOT_SUPPORTED; }
|
2009-11-15 21:29:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void* fBuffer;
|
|
|
|
size_t fSize;
|
|
|
|
size_t fBytesWritten;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-30 15:05:38 +00:00
|
|
|
} // namespace BHPKG
|
2011-01-27 23:17:03 +00:00
|
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
2011-01-30 15:05:38 +00:00
|
|
|
#endif // _PACKAGE__HPKG__DATA_OUTPUT_H_
|