#include <apt.h>
Classes | |
class | Iterator |
class | RecordIterator |
Public Types | |
typedef Iterator | iterator |
typedef RecordIterator | record_iterator |
Public Member Functions | |
Apt () | |
Create the Apt data provider. | |
~Apt () | |
iterator | begin () const |
iterator | end () const |
record_iterator | recordBegin () const |
record_iterator | recordEnd () const |
size_t | size () const |
Return the number of packages in the archive. | |
bool | isValid (const std::string &pkg) const |
Validate a package name, returning trye if it exists in the APT database, or false if it does not. | |
std::string | validate (const std::string &pkg) const |
Validate a package name, returning it if it exists in the APT database, or returning the empty string if it does not. | |
Version | validate (const Version &ver) const |
Validate a Version, returning it if it exists in the APT database, or returning the invalid version if it does not. | |
Version | installedVersion (const std::string &pkg) const |
Return the installed version for a package. | |
Version | candidateVersion (const std::string &pkg) const |
Return the candidate version for a package. | |
Version | anyVersion (const std::string &pkg) const |
Return the candidate version for a package, if available, or the installed version otherwise. | |
PackageState | state (const std::string &pkg) const |
Return state information on a package. | |
std::string | rawRecord (const std::string &pkg) const |
Perform a package search. | |
std::string | rawRecord (const Version &ver) const |
Get the raw package record for the given Version. | |
time_t | timestamp () |
Timestamp of when the apt index was last modified. | |
void | checkCacheUpdates () |
Check if the cache has been changed by another process, and reopen it if that is the case. | |
void | invalidateTimestamp () |
Invalidate the cache timestamp used to track cache updates. | |
Protected Attributes | |
AptImplementation * | impl |
This class wraps the Apt cache and allows to query it in various ways.
typedef Iterator ept::apt::Apt::iterator |
ept::apt::Apt::Apt | ( | ) |
Create the Apt data provider.
ept::apt::Apt::~Apt | ( | ) |
References impl.
Version ept::apt::Apt::anyVersion | ( | const std::string & | pkg | ) | const |
Return the candidate version for a package, if available, or the installed version otherwise.
References impl, and ept::core::record::Version.
Referenced by TestApt::rawRecord(), rawRecord(), and TestApt::versions().
Apt::iterator ept::apt::Apt::begin | ( | ) | const |
References impl.
Referenced by TestApt::aptExists(), TestPopcon::haveScores(), TestApt::iterators(), and TestApt::stlIteration().
Version ept::apt::Apt::candidateVersion | ( | const std::string & | pkg | ) | const |
Return the candidate version for a package.
References impl, and ept::core::record::Version.
Referenced by TestApt::rawRecord(), TestApt::versions(), and TestApt::versionValidity().
void ept::apt::Apt::checkCacheUpdates | ( | ) |
Check if the cache has been changed by another process, and reopen it if that is the case.
Note that this method can invalidate all existing iterators.
References impl, and timestamp().
Referenced by TestApt::checkUpdates().
Apt::iterator ept::apt::Apt::end | ( | ) | const |
Referenced by TestApt::aptExists(), TestPopcon::haveScores(), TestApt::iterators(), and TestApt::stlIteration().
Version ept::apt::Apt::installedVersion | ( | const std::string & | pkg | ) | const |
Return the installed version for a package.
References impl, and ept::core::record::Version.
Referenced by TestApt::versions().
void ept::apt::Apt::invalidateTimestamp | ( | ) |
Invalidate the cache timestamp used to track cache updates.
References impl.
Referenced by TestApt::checkUpdates().
bool ept::apt::Apt::isValid | ( | const std::string & | pkg | ) | const |
Validate a package name, returning trye if it exists in the APT database, or false if it does not.
References impl.
Referenced by TestApt::checkUpdates(), validate(), and TestApt::validity().
std::string ept::apt::Apt::rawRecord | ( | const Version & | ver | ) | const |
Get the raw package record for the given Version.
References impl, ept::apt::Version::name(), and ept::apt::Version::version().
std::string ept::apt::Apt::rawRecord | ( | const std::string & | pkg | ) | const |
Perform a package search.
All packages for which the functor filter returns true, are passed to the functor out. Get the raw package record for the given Version
References anyVersion().
Referenced by TestApt::rawRecord().
Apt::record_iterator ept::apt::Apt::recordBegin | ( | ) | const |
References impl.
Referenced by TestApt::recordIteration(), TestApt::recordIteration2(), and TestApt::stlRecordIteration().
Apt::record_iterator ept::apt::Apt::recordEnd | ( | ) | const |
Referenced by TestApt::recordIteration(), TestApt::recordIteration2(), and TestApt::stlRecordIteration().
size_t ept::apt::Apt::size | ( | ) | const |
PackageState ept::apt::Apt::state | ( | const std::string & | pkg | ) | const |
time_t ept::apt::Apt::timestamp | ( | ) |
Timestamp of when the apt index was last modified.
References ept::core::aptTimestamp().
Referenced by checkCacheUpdates(), ept::textsearch::TextSearch::needsRebuild(), and TestApt::timestamp().
Validate a Version, returning it if it exists in the APT database, or returning the invalid version if it does not.
References impl, ept::apt::Version::name(), ept::apt::Version::version(), and ept::core::record::Version.
std::string ept::apt::Apt::validate | ( | const std::string & | pkg | ) | const [inline] |
Validate a package name, returning it if it exists in the APT database, or returning the empty string if it does not.
References isValid().
Referenced by TestApt::rawRecord(), and TestApt::versionValidity().
AptImplementation* ept::apt::Apt::impl [protected] |
Referenced by anyVersion(), begin(), candidateVersion(), checkCacheUpdates(), installedVersion(), invalidateTimestamp(), isValid(), rawRecord(), recordBegin(), size(), state(), validate(), and ~Apt().