Pull class BPackageInfoSet out of BRepositoryCache
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#include <../os/package/PackageInfoSet.h>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE_PACKAGE_INFO_SET_H_
|
||||
#define _PACKAGE_PACKAGE_INFO_SET_H_
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BPackageInfo;
|
||||
|
||||
|
||||
class BPackageInfoSet {
|
||||
public:
|
||||
class Iterator;
|
||||
|
||||
public:
|
||||
BPackageInfoSet();
|
||||
virtual ~BPackageInfoSet();
|
||||
|
||||
status_t Init();
|
||||
|
||||
status_t AddInfo(const BPackageInfo& info);
|
||||
void MakeEmpty();
|
||||
|
||||
uint32 CountInfos() const;
|
||||
Iterator GetIterator() const;
|
||||
|
||||
private:
|
||||
struct PackageInfo;
|
||||
struct PackageInfoHashDefinition;
|
||||
struct PackageMap;
|
||||
|
||||
friend class Iterator;
|
||||
|
||||
private:
|
||||
PackageMap* fPackageMap;
|
||||
};
|
||||
|
||||
|
||||
class BPackageInfoSet::Iterator {
|
||||
public:
|
||||
Iterator();
|
||||
Iterator(const BPackageInfoSet* set);
|
||||
|
||||
bool HasNext() const;
|
||||
const BPackageInfo* Next();
|
||||
|
||||
private:
|
||||
friend class BRepositoryCache;
|
||||
|
||||
private:
|
||||
const BPackageInfoSet* fSet;
|
||||
PackageInfo* fNextInfo;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE_PACKAGE_INFO_SET_H_
|
||||
@@ -9,18 +9,16 @@
|
||||
#include <Entry.h>
|
||||
#include <String.h>
|
||||
|
||||
#include <package/PackageInfoSet.h>
|
||||
#include <package/RepositoryInfo.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BPackageInfo;
|
||||
|
||||
|
||||
class BRepositoryCache {
|
||||
public:
|
||||
class Iterator;
|
||||
typedef BPackageInfoSet::Iterator Iterator;
|
||||
|
||||
public:
|
||||
BRepositoryCache();
|
||||
@@ -38,39 +36,15 @@ public:
|
||||
Iterator GetIterator() const;
|
||||
|
||||
private:
|
||||
struct PackageInfo;
|
||||
struct PackageInfoHashDefinition;
|
||||
struct PackageMap;
|
||||
struct RepositoryContentHandler;
|
||||
struct StandardErrorOutput;
|
||||
|
||||
friend class Iterator;
|
||||
|
||||
private:
|
||||
BEntry fEntry;
|
||||
BRepositoryInfo fInfo;
|
||||
bool fIsUserSpecific;
|
||||
|
||||
PackageMap* fPackageMap;
|
||||
};
|
||||
|
||||
|
||||
class BRepositoryCache::Iterator {
|
||||
public:
|
||||
Iterator();
|
||||
|
||||
bool HasNext() const;
|
||||
const BPackageInfo* Next();
|
||||
|
||||
private:
|
||||
Iterator(const BRepositoryCache* cache);
|
||||
|
||||
private:
|
||||
friend class BRepositoryCache;
|
||||
|
||||
private:
|
||||
const BRepositoryCache* fCache;
|
||||
PackageInfo* fNextInfo;
|
||||
BPackageInfoSet fPackages;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user