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