2 * Copyright 2009-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _PACKAGE__HPKG__DATA_READER_H_
6 #define _PACKAGE__HPKG__DATA_READER_H_
9 #include <SupportDefs.h>
15 namespace BPackageKit
{
22 virtual ~BDataReader();
24 virtual status_t
ReadData(off_t offset
, void* buffer
,
29 class BAbstractBufferedDataReader
: public BDataReader
{
31 virtual ~BAbstractBufferedDataReader();
33 virtual status_t
ReadData(off_t offset
, void* buffer
,
35 virtual status_t
ReadDataToOutput(off_t offset
, size_t size
,
40 class BFDDataReader
: public BDataReader
{
42 BFDDataReader(int fd
);
46 virtual status_t
ReadData(off_t offset
, void* buffer
,
54 class BAttributeDataReader
: public BDataReader
{
56 BAttributeDataReader(int fd
,
57 const char* attribute
, uint32 type
);
59 virtual status_t
ReadData(off_t offset
, void* buffer
,
65 const char* fAttribute
;
69 class BBufferDataReader
: public BAbstractBufferedDataReader
{
71 BBufferDataReader(const void* data
, size_t size
);
73 virtual status_t
ReadData(off_t offset
, void* buffer
,
75 virtual status_t
ReadDataToOutput(off_t offset
, size_t size
,
86 } // namespace BPackageKit
89 #endif // _PACKAGE__HPKG__DATA_READER_H_