2 * Copyright 2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _PACKAGE__PACKAGE_RESOLVABLE_H_
6 #define _PACKAGE__PACKAGE_RESOLVABLE_H_
11 #include <package/PackageVersion.h>
14 namespace BPackageKit
{
18 class BPackageResolvableData
;
20 using BHPKG::BPackageResolvableData
;
24 * Defines a resolvable (something other packages can depend upon).
25 * Each resolvable is defined as a name (with an optional type prefix),
26 * an optional version, and an optional compatibility version (the least
27 * version the resolvable is backwards compatible with).
29 * resolvable ::= <name>['='<version>]['compat' '>=' <version>]
30 * name ::= [<type>':']<word>
31 * type ::= 'lib' | 'cmd' | 'app' | 'add_on'
33 * The type doesn't have any specific meaning to the dependency resolver,
34 * it just facilitates doing specific queries on the repository (like "is
35 * there any package providing the 'svn' command that the user just typed?").
36 * At a later stage, more types may be added in order to declare additional
37 * entities, e.g. translators.
42 * subversion=1.5 compat>=1.0
45 class BPackageResolvable
{
49 const BPackageResolvableData
& data
);
50 BPackageResolvable(const BString
& name
,
51 const BPackageVersion
& version
53 const BPackageVersion
& compatibleVersion
56 status_t
InitCheck() const;
58 const BString
& Name() const;
59 const BPackageVersion
& Version() const;
60 const BPackageVersion
& CompatibleVersion() const;
62 BString
ToString() const;
64 void SetTo(const BString
& name
,
65 const BPackageVersion
& version
67 const BPackageVersion
& compatibleVersion
73 BPackageVersion fVersion
;
74 BPackageVersion fCompatibleVersion
;
78 } // namespace BPackageKit
81 #endif // _PACKAGE__PACKAGE_RESOLVABLE_H_