xref: /haiku/headers/os/package/RepositoryCache.h (revision fc75f2df0c666dcc61be83c4facdd3132340c2fb)
1 /*
2  * Copyright 2011, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _PACKAGE__REPOSITORY_CACHE_H_
6 #define _PACKAGE__REPOSITORY_CACHE_H_
7 
8 
9 #include <Entry.h>
10 #include <String.h>
11 
12 #include <package/PackageInfoSet.h>
13 #include <package/RepositoryInfo.h>
14 
15 
16 namespace BPackageKit {
17 
18 
19 class BRepositoryCache {
20 public:
21 			typedef BPackageInfoSet::Iterator Iterator;
22 
23 public:
24 								BRepositoryCache();
25 	virtual						~BRepositoryCache();
26 
27 			status_t			SetTo(const BEntry& entry);
28 
29 			const BRepositoryInfo&	Info() const;
30 			const BEntry&		Entry() const;
31 			bool				IsUserSpecific() const;
32 
33 			void				SetIsUserSpecific(bool isUserSpecific);
34 
35 			uint32				CountPackages() const;
36 			Iterator			GetIterator() const;
37 
38 private:
39 			struct RepositoryContentHandler;
40 			struct StandardErrorOutput;
41 
42 private:
43 			BEntry				fEntry;
44 			BRepositoryInfo		fInfo;
45 			bool				fIsUserSpecific;
46 
47 			BPackageInfoSet		fPackages;
48 };
49 
50 
51 }	// namespace BPackageKit
52 
53 
54 #endif // _PACKAGE__REPOSITORY_CACHE_H_
55