LibPkg
|
A class to represent a package version. More...
#include <version.h>
Classes | |
class | parse_error |
An exception class for reporting parse errors. More... | |
Public Member Functions | |
version () | |
Construct version with default value. More... | |
version (const string &epoch, const string &upstream_version, const string &package_version) | |
Construct version from components. More... | |
version (string::const_iterator first, string::const_iterator last) | |
Construct version from sequence. More... | |
version (const string &verstr) | |
Construct version from string. More... | |
operator string () const | |
Convert version to string. More... | |
string | epoch () const |
Get epoch. More... | |
string | upstream_version () const |
Get upstream version. More... | |
string | package_version () const |
Get package version. More... | |
A class to represent a package version.
Syntax and semantics are as specified in version 3.8.0 of the Debian Policy Manual.
pkg::version::version | ( | ) |
Construct version with default value.
By default the epoch, upstream version and package version are all empty.
Referenced by pkg::update::poll(), and pkg::binary_control_table::update().
pkg::version::version | ( | const string & | epoch, |
const string & | upstream_version, | ||
const string & | package_version | ||
) |
Construct version from components.
If any of these components contain invalid characters then a parse error is thrown.
epoch | the epoch |
upstream_version | the upstream version |
package_version | the package version |
pkg::version::version | ( | string::const_iterator | first, |
string::const_iterator | last | ||
) |
Construct version from sequence.
If the version string contains any illegal characters then a parse error is thrown.
first | the beginning of the sequence |
last | the end of the sequence |
pkg::version::version | ( | const string & | verstr | ) |
Construct version from string.
If the version string contains any illegal characters then a parse error is thrown.
verstr | the version string |
pkg::version::operator string | ( | ) | const |
Convert version to string.
A colon (to terminate the epoch) is included if the epoch is non-empty, or if the upstream version contains one or more colons. A minus sign (to introduce the package version) is included if the package version is non-empty, or if the upstream version contains one or more minus signs.
|
inline |
Get epoch.
|
inline |
Get upstream version.
|
inline |
Get package version.
References pkg::operator!=(), pkg::operator<(), pkg::operator<=(), pkg::operator==(), pkg::operator>(), and pkg::operator>=().
Reference Manual | LibPkg | Version 0.9.0 (4 Sep 2020) |