2009-11-13 13:45:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef PACKAGE_DATA_READER_H
|
|
|
|
#define PACKAGE_DATA_READER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "DataReader.h"
|
|
|
|
|
|
|
|
|
2009-11-18 15:26:11 +00:00
|
|
|
class BufferCache;
|
2009-11-13 13:45:49 +00:00
|
|
|
class PackageData;
|
|
|
|
|
|
|
|
|
|
|
|
class PackageDataReader : public DataReader {
|
|
|
|
public:
|
|
|
|
PackageDataReader(DataReader* dataReader);
|
|
|
|
virtual ~PackageDataReader();
|
|
|
|
|
|
|
|
virtual status_t Init(const PackageData& data) = 0;
|
|
|
|
|
|
|
|
virtual uint64 Size() const = 0;
|
|
|
|
virtual size_t BlockSize() const = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
DataReader* fDataReader;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PackageDataReaderFactory {
|
|
|
|
public:
|
2009-11-18 15:26:11 +00:00
|
|
|
PackageDataReaderFactory(
|
|
|
|
BufferCache* bufferCache);
|
|
|
|
|
|
|
|
status_t CreatePackageDataReader(DataReader* dataReader,
|
2009-11-13 13:45:49 +00:00
|
|
|
const PackageData& data,
|
|
|
|
PackageDataReader*& _reader);
|
2009-11-18 15:26:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BufferCache* fBufferCache;
|
2009-11-13 13:45:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PACKAGE_DATA_READER_H
|