1 /* 2 * Copyright 2009,2011, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _PACKAGE__HPKG__V1__PACKAGE_READER_H_ 6 #define _PACKAGE__HPKG__V1__PACKAGE_READER_H_ 7 8 9 #include <SupportDefs.h> 10 11 12 namespace BPackageKit { 13 14 namespace BHPKG { 15 16 17 class BErrorOutput; 18 19 20 namespace V1 { 21 22 23 namespace BPrivate { 24 class PackageReaderImpl; 25 } 26 using BPrivate::PackageReaderImpl; 27 28 class BLowLevelPackageContentHandler; 29 class BPackageContentHandler; 30 31 32 class BPackageReader { 33 public: 34 BPackageReader( 35 BErrorOutput* errorOutput); 36 ~BPackageReader(); 37 38 status_t Init(const char* fileName); 39 status_t Init(int fd, bool keepFD); 40 status_t ParseContent( 41 BPackageContentHandler* contentHandler); 42 status_t ParseContent(BLowLevelPackageContentHandler* 43 contentHandler); 44 45 int PackageFileFD(); 46 private: 47 PackageReaderImpl* fImpl; 48 }; 49 50 51 } // namespace V1 52 53 } // namespace BHPKG 54 55 } // namespace BPackageKit 56 57 58 #endif // _PACKAGE__HPKG__V1__PACKAGE_READER_H_ 59