2013-05-18 06:11:01 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _PACKAGE__HPKG__PRIVATE__PACKAGE_FILE_HEAP_READER_H_
|
|
|
|
#define _PACKAGE__HPKG__PRIVATE__PACKAGE_FILE_HEAP_READER_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <Array.h>
|
|
|
|
#include <package/hpkg/PackageFileHeapAccessorBase.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
|
|
|
|
namespace BHPKG {
|
|
|
|
|
|
|
|
|
|
|
|
class BDataReader;
|
|
|
|
class BErrorOutput;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
|
|
|
|
class PackageFileHeapReader : public PackageFileHeapAccessorBase {
|
|
|
|
public:
|
|
|
|
PackageFileHeapReader(BErrorOutput* errorOutput,
|
2014-07-12 15:34:56 +04:00
|
|
|
BPositionIO* file, off_t heapOffset,
|
2013-05-18 06:11:01 +04:00
|
|
|
off_t compressedHeapSize,
|
2014-06-30 23:35:03 +04:00
|
|
|
uint64 uncompressedHeapSize,
|
|
|
|
DecompressionAlgorithmOwner*
|
|
|
|
decompressionAlgorithm);
|
2013-05-18 06:11:01 +04:00
|
|
|
~PackageFileHeapReader();
|
|
|
|
|
|
|
|
status_t Init();
|
|
|
|
|
|
|
|
PackageFileHeapReader* Clone() const;
|
|
|
|
|
|
|
|
const OffsetArray& Offsets() const
|
|
|
|
{ return fOffsets; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual status_t ReadAndDecompressChunk(size_t chunkIndex,
|
|
|
|
void* compressedDataBuffer,
|
|
|
|
void* uncompressedDataBuffer);
|
|
|
|
|
|
|
|
private:
|
|
|
|
OffsetArray fOffsets;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
} // namespace BHPKG
|
|
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _PACKAGE__HPKG__PRIVATE__PACKAGE_FILE_HEAP_READER_H_
|