haiku/headers/os/package/hpkg/PackageReader.h
Ingo Weinhold d59e0feb59 package: Suppress version mismatch errors where V1 is supported
* Add flags parameter to Init() of BPackageReader and friends.
* Introduce flag B_HPKG_READER_DONT_PRINT_VERSION_MISMATCH_MESSAGE and
  don't print a version mismatch error when given.
* package extract/list: Use the new flag.
2013-05-25 01:12:31 +02:00

57 lines
1.1 KiB
C++

/*
* Copyright 2009,2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__HPKG__PACKAGE_READER_H_
#define _PACKAGE__HPKG__PACKAGE_READER_H_
#include <SupportDefs.h>
namespace BPackageKit {
namespace BHPKG {
namespace BPrivate {
class PackageReaderImpl;
}
using BPrivate::PackageReaderImpl;
class BAbstractBufferedDataReader;
class BErrorOutput;
class BLowLevelPackageContentHandler;
class BPackageContentHandler;
class BPackageReader {
public:
BPackageReader(BErrorOutput* errorOutput);
~BPackageReader();
status_t Init(const char* fileName, uint32 flags = 0);
status_t Init(int fd, bool keepFD, uint32 flags = 0);
status_t ParseContent(
BPackageContentHandler* contentHandler);
status_t ParseContent(BLowLevelPackageContentHandler*
contentHandler);
int PackageFileFD();
BAbstractBufferedDataReader* HeapReader() const;
// Only valid as long as the reader lives.
private:
PackageReaderImpl* fImpl;
};
} // namespace BHPKG
} // namespace BPackageKit
#endif // _PACKAGE__HPKG__PACKAGE_READER_H_