xref: /haiku/headers/private/package/hpkg/RepositoryReaderImpl.h (revision e527b796319f21ca025f68e1964df140daa6de35)
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 			status_t			Init(BPositionIO* file, bool keepFile);
34 
35 			status_t			GetRepositoryInfo(
36 									BRepositoryInfo* _repositoryInfo) const;
37 
38 			status_t			ParseContent(
39 									BRepositoryContentHandler* contentHandler);
40 
41 private:
42 			class PackagesAttributeHandler;
43 			class PackageContentHandlerAdapter;
44 
45 private:
46 			BRepositoryInfo		fRepositoryInfo;
47 };
48 
49 
50 }	// namespace BPrivate
51 
52 }	// namespace BHPKG
53 
54 }	// namespace BPackageKit
55 
56 
57 #endif	// _PACKAGE__HPKG__PRIVATE__REPOSITORY_READER_IMPL_H_
58