LibPkg
|
A class to represent a package dependency. More...
#include <dependency.h>
Classes | |
class | parse_error |
An exception class for reporting parse errors. More... | |
Public Types | |
enum | relation_type { relation_al, relation_eq, relation_lt, relation_ge, relation_le, relation_gt } |
An enumerated type to specify a relational operator for comparing versions. More... | |
Public Member Functions | |
dependency () | |
Construct dependency with default value. More... | |
dependency (const string &pkgname, relation_type relation, const pkg::version &version) | |
Construct dependency from components. More... | |
dependency (string::const_iterator first, string::const_iterator last) | |
Construct dependency from sequence. More... | |
dependency (const string &depstr) | |
Construct dependency from string. More... | |
~dependency () | |
Destroy dependency. More... | |
operator string () const | |
Convert dependency to string. More... | |
const string & | pkgname () const |
Get package name. More... | |
relation_type | relation () const |
Get relational operator. More... | |
const pkg::version & | version () const |
Get version. More... | |
bool | matches (const string &pkgname, const pkg::version &pkgvrsn) const |
Test whether dependency is satisfied by a given package/version. More... | |
A class to represent a package dependency.
Syntax and semantics are as specified in version 3.5.6 of the Debian Policy Manual, except that:
An enumerated type to specify a relational operator for comparing versions.
pkg::dependency::dependency | ( | ) |
Construct dependency with default value.
By default the dependency has an empty package name and is satisfied by any version.
pkg::dependency::dependency | ( | const string & | pkgname, |
relation_type | relation, | ||
const pkg::version & | version | ||
) |
Construct dependency from components.
pkgname | the package name |
relation | the relational operator to be satisfied |
version | the version to which the relational operator refers |
pkg::dependency::dependency | ( | string::const_iterator | first, |
string::const_iterator | last | ||
) |
Construct dependency from sequence.
first | the beginning of the sequence |
last | the end of the sequence |
pkg::dependency::dependency | ( | const string & | depstr | ) |
Construct dependency from string.
depstr | the dependency string |
pkg::dependency::~dependency | ( | ) |
Destroy dependency.
pkg::dependency::operator string | ( | ) | const |
Convert dependency to string.
References relation_al, relation_eq, relation_ge, relation_gt, relation_le, and relation_lt.
|
inline |
|
inline |
Get relational operator.
|
inline |
bool pkg::dependency::matches | ( | const string & | pkgname, |
const pkg::version & | pkgvrsn | ||
) | const |
Test whether dependency is satisfied by a given package/version.
pkgname | the name of the package to be tested |
pkgvrsn | the version of the package to be tested |
References relation_al, relation_eq, relation_ge, relation_gt, relation_le, and relation_lt.
Referenced by pkg::pkgbase::remove_auto(), and version().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |