2011-01-22 01:18:58 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2011, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-01-28 02:17:03 +03:00
|
|
|
#ifndef _PACKAGE__PACKAGE_ROSTER_H_
|
|
|
|
#define _PACKAGE__PACKAGE_ROSTER_H_
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <Entry.h>
|
2011-01-24 23:48:03 +03:00
|
|
|
#include <FindDirectory.h>
|
2011-01-22 01:18:58 +03:00
|
|
|
#include <Path.h>
|
|
|
|
|
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
template <class T> class BObjectList;
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
namespace BPackageKit {
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
struct BRepositoryConfigVisitor {
|
|
|
|
virtual ~BRepositoryConfigVisitor()
|
2011-01-22 01:18:58 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual status_t operator()(const BEntry& entry) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
class BRepositoryCache;
|
|
|
|
class BRepositoryConfig;
|
2011-01-24 23:48:03 +03:00
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
class BPackageRoster {
|
2011-01-22 01:18:58 +03:00
|
|
|
public:
|
2011-01-25 20:07:27 +03:00
|
|
|
BPackageRoster();
|
|
|
|
~BPackageRoster();
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t GetCommonRepositoryCachePath(BPath* path,
|
|
|
|
bool create = false) const;
|
|
|
|
status_t GetUserRepositoryCachePath(BPath* path,
|
|
|
|
bool create = false) const;
|
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
status_t GetCommonRepositoryConfigPath(BPath* path,
|
|
|
|
bool create = false) const;
|
|
|
|
status_t GetUserRepositoryConfigPath(BPath* path,
|
|
|
|
bool create = false) const;
|
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t GetRepositoryNames(BObjectList<BString>& names);
|
|
|
|
|
2011-01-22 01:18:58 +03:00
|
|
|
status_t VisitCommonRepositoryConfigs(
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfigVisitor& visitor);
|
2011-01-22 01:18:58 +03:00
|
|
|
status_t VisitUserRepositoryConfigs(
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfigVisitor& visitor);
|
2011-01-22 01:18:58 +03:00
|
|
|
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t GetRepositoryCache(const BString& name,
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryCache* repositoryCache);
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t GetRepositoryConfig(const BString& name,
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfig* repositoryConfig);
|
2011-01-22 01:18:58 +03:00
|
|
|
private:
|
2011-01-24 23:48:03 +03:00
|
|
|
status_t _GetRepositoryPath(BPath* path, bool create,
|
|
|
|
directory_which whichDir) const;
|
2011-01-22 01:18:58 +03:00
|
|
|
status_t _VisitRepositoryConfigs(const BPath& path,
|
2011-01-25 20:07:27 +03:00
|
|
|
BRepositoryConfigVisitor& visitor);
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-25 20:07:27 +03:00
|
|
|
} // namespace BPackageKit
|
2011-01-22 01:18:58 +03:00
|
|
|
|
|
|
|
|
2011-01-28 02:17:03 +03:00
|
|
|
#endif // _PACKAGE__PACKAGE_ROSTER_H_
|