2011-01-22 01:18:58 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2011, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-25 20:07:27 +03:00
|
|
|
#ifndef _PACKAGE__REPOSITORY_CACHE_H_
|
|
|
|
#define _PACKAGE__REPOSITORY_CACHE_H_
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
#include <Entry.h>
|
|
|
|
#include <String.h>
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-07-17 01:11:25 +04:00
|
|
|
#include <package/PackageInfoSet.h>
|
2011-02-09 22:11:23 +03:00
|
|
|
#include <package/RepositoryInfo.h>
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPackageKit {
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
class BRepositoryCache {
|
2011-07-16 16:02:49 +04:00
|
|
|
public:
|
2011-07-17 01:11:25 +04:00
|
|
|
typedef BPackageInfoSet::Iterator Iterator;
|
2011-07-16 16:02:49 +04:00
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
public:
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryCache();
|
|
|
|
virtual ~BRepositoryCache();
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
status_t SetTo(const BEntry& entry);
|
|
|
|
|
2011-02-09 22:11:23 +03:00
|
|
|
const BRepositoryInfo& Info() const;
|
2011-01-24 23:48:03 +03:00
|
|
|
const BEntry& Entry() const;
|
|
|
|
bool IsUserSpecific() const;
|
|
|
|
|
|
|
|
void SetIsUserSpecific(bool isUserSpecific);
|
|
|
|
|
2011-07-16 16:02:49 +04:00
|
|
|
uint32 CountPackages() const;
|
|
|
|
Iterator GetIterator() const;
|
2011-02-15 18:47:20 +03:00
|
|
|
|
|
|
|
private:
|
2011-07-16 16:02:49 +04:00
|
|
|
struct RepositoryContentHandler;
|
|
|
|
struct StandardErrorOutput;
|
2011-02-15 18:47:20 +03:00
|
|
|
|
2011-07-16 16:02:49 +04:00
|
|
|
private:
|
2011-01-24 23:48:03 +03:00
|
|
|
BEntry fEntry;
|
2011-02-09 22:11:23 +03:00
|
|
|
BRepositoryInfo fInfo;
|
2011-01-24 23:48:03 +03:00
|
|
|
bool fIsUserSpecific;
|
2011-02-15 18:47:20 +03:00
|
|
|
|
2011-07-17 01:11:25 +04:00
|
|
|
BPackageInfoSet fPackages;
|
2011-07-16 16:02:49 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPackageKit
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
#endif // _PACKAGE__REPOSITORY_CACHE_H_
|