Remove BPackageKit::BDataOutput

Use BDataIO instead.
This commit is contained in:
Ingo Weinhold
2014-06-23 22:58:15 +02:00
parent 0d8b44e25b
commit 32832cbe47
32 changed files with 102 additions and 211 deletions
-45
View File
@@ -1,45 +0,0 @@
/*
* Copyright 2009,2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__DATA_OUTPUT_H_
#define _PACKAGE__HPKG__DATA_OUTPUT_H_
#include <SupportDefs.h>
namespace BPackageKit {
namespace BHPKG {
class BDataOutput {
public:
virtual ~BDataOutput();
virtual status_t WriteData(const void* buffer, size_t size) = 0;
};
class BBufferDataOutput : public BDataOutput {
public:
BBufferDataOutput(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;
};
} // namespace BHPKG
} // namespace BPackageKit
#endif // _PACKAGE__HPKG__DATA_OUTPUT_H_
+6 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2009,2011, Haiku, Inc.
* Copyright 2009-2014, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__DATA_READER_H_
@@ -9,14 +9,14 @@
#include <SupportDefs.h>
class BDataIO;
namespace BPackageKit {
namespace BHPKG {
class BDataOutput;
class BDataReader {
public:
virtual ~BDataReader();
@@ -33,7 +33,7 @@ public:
virtual status_t ReadData(off_t offset, void* buffer,
size_t size);
virtual status_t ReadDataToOutput(off_t offset, size_t size,
BDataOutput* output) = 0;
BDataIO* output) = 0;
};
@@ -73,7 +73,7 @@ public:
virtual status_t ReadData(off_t offset, void* buffer,
size_t size);
virtual status_t ReadDataToOutput(off_t offset, size_t size,
BDataOutput* output);
BDataIO* output);
private:
const void* fData;