haiku/headers/private/package/hpkg/PackageDataReader.h
Oliver Tappe 0d6b3b20e1 More work on package kit:
* added class BPackageInfo, which contains packaging attributes of
  a package (the values relevant for package management) 
* implemented parser (mostly) for reading a BPackageInfo from a config
  file (.PackageInfo) in order to pass them on to the PackageWriter 
  when creating a package
* pulled hpkg-related stuff from bin/package into the package kit
* adjusted packagefs-Volume to skip .PackageInfo files when populating
  the mountpoint, as those files shouldn't appear as part of an
  activated package


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-27 23:17:03 +00:00

66 lines
1.2 KiB
C++

/*
* 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 <package/hpkg/DataReader.h>
namespace BPackageKit {
namespace BHaikuPackage {
namespace BPrivate {
class BufferCache;
class DataOutput;
class PackageData;
class PackageDataReader : public DataReader {
public:
PackageDataReader(DataReader* dataReader);
virtual ~PackageDataReader();
virtual status_t Init(const PackageData& data) = 0;
virtual status_t ReadData(off_t offset, void* buffer,
size_t size);
virtual status_t ReadDataToOutput(off_t offset, size_t size,
DataOutput* output) = 0;
virtual uint64 Size() const = 0;
virtual size_t BlockSize() const = 0;
protected:
DataReader* fDataReader;
};
class PackageDataReaderFactory {
public:
PackageDataReaderFactory(
BufferCache* bufferCache);
status_t CreatePackageDataReader(DataReader* dataReader,
const PackageData& data,
PackageDataReader*& _reader);
private:
BufferCache* fBufferCache;
};
} // namespace BPrivate
} // namespace BHaikuPackage
} // namespace BPackageKit
#endif // PACKAGE_DATA_READER_H