xref: /haiku/headers/private/package/hpkg/RepositoryReaderImpl.h (revision 73254051b196497dfee9ab89eb0c2f60cc305819)
1 /*
2  * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de>
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
6 #define _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
7 
8 
9 #include <package/hpkg/ReaderImplBase.h>
10 
11 #include <package/RepositoryInfo.h>
12 
13 
14 namespace BPackageKit {
15 
16 namespace BHPKG {
17 
18 
19 class BRepositoryContentHandler;
20 
21 
22 namespace BPrivate {
23 
24 
25 class RepositoryReaderImpl : public ReaderImplBase {
26 	typedef	ReaderImplBase		inherited;
27 public:
28 								RepositoryReaderImpl(BErrorOutput* errorOutput);
29 								~RepositoryReaderImpl();
30 
31 			status_t			Init(const char* fileName);
32 			status_t			Init(int fd, bool keepFD);
33 
34 			status_t			GetRepositoryInfo(
35 									BRepositoryInfo* _repositoryInfo) const;
36 
37 			status_t			ParseContent(
38 									BRepositoryContentHandler* contentHandler);
39 
40 private:
41 			class PackagesAttributeHandler;
42 			class PackageContentHandlerAdapter;
43 
44 private:
45 			BRepositoryInfo		fRepositoryInfo;
46 };
47 
48 
49 }	// namespace BPrivate
50 
51 }	// namespace BHPKG
52 
53 }	// namespace BPackageKit
54 
55 
56 #endif	// _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
57