haiku/headers/os/package/PackageRoster.h
Oliver Tappe 0d6b3b20e1 More work on package kit:
* added class BPackageInfo, which contains packaging attributes of
  a package (the values relevant for package management) 
* implemented parser (mostly) for reading a BPackageInfo from a config
  file (.PackageInfo) in order to pass them on to the PackageWriter 
  when creating a package
* pulled hpkg-related stuff from bin/package into the package kit
* adjusted packagefs-Volume to skip .PackageInfo files when populating
  the mountpoint, as those files shouldn't appear as part of an
  activated package


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-27 23:17:03 +00:00

72 lines
1.6 KiB
C++

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