Restore the "GPL licensing not permitted" in GLUT license headers.
[haiku.git] / headers / os / package / PackageResolvable.h
blobaad9f3e90c2083aa3e76a6c7a33fb2eb804edf50
1 /*
2 * Copyright 2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _PACKAGE__PACKAGE_RESOLVABLE_H_
6 #define _PACKAGE__PACKAGE_RESOLVABLE_H_
9 #include <String.h>
11 #include <package/PackageVersion.h>
14 namespace BPackageKit {
17 namespace BHPKG {
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.
39 * String examples:
40 * haiku=r1
41 * lib:libssl=0.9.8i
42 * subversion=1.5 compat>=1.0
43 * cmd:svn
45 class BPackageResolvable {
46 public:
47 BPackageResolvable();
48 BPackageResolvable(
49 const BPackageResolvableData& data);
50 BPackageResolvable(const BString& name,
51 const BPackageVersion& version
52 = BPackageVersion(),
53 const BPackageVersion& compatibleVersion
54 = BPackageVersion());
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
66 = BPackageVersion(),
67 const BPackageVersion& compatibleVersion
68 = BPackageVersion());
69 void Clear();
71 private:
72 BString fName;
73 BPackageVersion fVersion;
74 BPackageVersion fCompatibleVersion;
78 } // namespace BPackageKit
81 #endif // _PACKAGE__PACKAGE_RESOLVABLE_H_