LibPkg
|
A class to represent the current or required status of a package. More...
#include <status.h>
Classes | |
class | parse_error |
An exception class for reporting parse errors. More... | |
Public Types | |
enum | state_type { state_not_present, state_removed, state_half_unpacked, state_unpacked, state_half_configured, state_installed } |
enum | flag_type { flag_auto, flag_hold } |
enum | internal_flag_type { flag_must_remove, flag_must_install, flag_must_upgrade } |
Public Member Functions | |
status () | |
Construct status. More... | |
status (state_type state, const string &version) | |
Construct status given installation state and version. More... | |
~status () | |
Destroy status. More... | |
state_type | state () const |
Get installation state. More... | |
bool | flag (flag_type flag) const |
Get status flag. More... | |
bool | flag (internal_flag_type flag) const |
Get internal flag. More... | |
unsigned int | flags () const |
Get status flags. More... | |
string | version () const |
Get package version. More... | |
void | state (state_type state) |
Set installation state. More... | |
void | flag (flag_type flag, bool value) |
Set status flag. More... | |
void | flag (internal_flag_type flag, bool value) |
Set internal flag. More... | |
void | version (const string &version) |
Set package version. More... | |
A class to represent the current or required status of a package.
The status consists of three components:
States are ordered, and it is meaningful to use the inequality operators to compare them. If state A is greater than state B then A is closer to the fully installed state.
Note that not-present is rarely used because this state is usually indicated by the absence of an entry in the status file.
pkg::status::status | ( | ) |
Construct status.
By default, the package is not-present and all flags are clear.
pkg::status::status | ( | state_type | state, |
const string & | version | ||
) |
Construct status given installation state and version.
By default, all flags are clear.
state | the required installation state |
version | the required version |
pkg::status::~status | ( | ) |
Destroy status.
|
inline |
Get installation state.
Referenced by pkg::config_req(), pkg::pkgbase::fix_dependencies(), pkg::operator!=(), pkg::operator==(), pkg::commit::poll(), pkg::purge_req(), pkg::pkgbase::remove_auto(), pkg::remove_req(), state(), and pkg::unpack_req().
|
inline |
Get status flag.
flag | the flag to be read |
Referenced by pkg::pkgbase::fix_dependencies(), flag(), and pkg::pkgbase::remove_auto().
|
inline |
Get internal flag.
flag | the flag to be read |
|
inline |
Get status flags.
Referenced by pkg::operator!=(), pkg::operator==(), and pkg::operator>>().
|
inline |
Get package version.
Referenced by pkg::config_req(), pkg::pkgbase::fix_dependencies(), pkg::operator!=(), pkg::operator==(), pkg::commit::poll(), pkg::pkgbase::remove_auto(), pkg::remove_req(), pkg::unpack_req(), and version().
void pkg::status::state | ( | state_type | state | ) |
void pkg::status::flag | ( | flag_type | flag, |
bool | value | ||
) |
void pkg::status::flag | ( | internal_flag_type | flag, |
bool | value | ||
) |
void pkg::status::version | ( | const string & | version | ) |
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |