libept
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
ept::apt::Apt Class Reference

High-level access to the Apt cache, as a data provider for the ept framework. More...

#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. More...
 
 ~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. More...
 
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. More...
 
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. More...
 
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. More...
 
Version installedVersion (const std::string &pkg) const
 Return the installed version for a package. More...
 
Version candidateVersion (const std::string &pkg) const
 Return the candidate version for a package. More...
 
Version anyVersion (const std::string &pkg) const
 Return the candidate version for a package, if available, or the installed version otherwise. More...
 
PackageState state (const std::string &pkg) const
 Return state information on a package. More...
 
std::string rawRecord (const std::string &pkg) const
 Perform a package search. More...
 
std::string rawRecord (const Version &ver) const
 Get the raw package record for the given Version. More...
 
const pkgCache * aptPkgCache () const
 Returns the pointer to the internal libapt pkgCache object used. More...
 
time_t timestamp ()
 Timestamp of when the apt index was last modified. More...
 
void checkCacheUpdates ()
 Check if the cache has been changed by another process, and reopen it if that is the case. More...
 
void invalidateTimestamp ()
 Invalidate the cache timestamp used to track cache updates. More...
 

Protected Attributes

AptImplementation * impl
 

Detailed Description

High-level access to the Apt cache, as a data provider for the ept framework.

This class wraps the Apt cache and allows to query it in various ways.

Member Typedef Documentation

◆ iterator

◆ record_iterator

Constructor & Destructor Documentation

◆ Apt()

ept::apt::Apt::Apt ( )

Create the Apt data provider.

◆ ~Apt()

ept::apt::Apt::~Apt ( )

References impl.

Member Function Documentation

◆ anyVersion()

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.

Referenced by rawRecord(), and register_tests().

◆ aptPkgCache()

const pkgCache * ept::apt::Apt::aptPkgCache ( ) const

Returns the pointer to the internal libapt pkgCache object used.

References impl.

◆ begin()

Apt::iterator ept::apt::Apt::begin ( ) const

References impl.

Referenced by register_tests().

◆ candidateVersion()

Version ept::apt::Apt::candidateVersion ( const std::string &  pkg) const

Return the candidate version for a package.

References impl.

Referenced by register_tests().

◆ checkCacheUpdates()

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 register_tests().

◆ end()

Apt::iterator ept::apt::Apt::end ( ) const

Referenced by register_tests().

◆ installedVersion()

Version ept::apt::Apt::installedVersion ( const std::string &  pkg) const

Return the installed version for a package.

References impl.

Referenced by register_tests().

◆ invalidateTimestamp()

void ept::apt::Apt::invalidateTimestamp ( )

Invalidate the cache timestamp used to track cache updates.

Warning
Do not use this method: it is here only to support the test cases, and may disappear in any future version.

References impl.

Referenced by register_tests().

◆ isValid()

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 register_tests().

◆ rawRecord() [1/2]

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 register_tests().

◆ rawRecord() [2/2]

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(), res, and ept::apt::Version::version().

◆ recordBegin()

Apt::record_iterator ept::apt::Apt::recordBegin ( ) const

References impl.

Referenced by register_tests().

◆ recordEnd()

Apt::record_iterator ept::apt::Apt::recordEnd ( ) const

Referenced by register_tests().

◆ size()

size_t ept::apt::Apt::size ( ) const

Return the number of packages in the archive.

References impl.

◆ state()

PackageState ept::apt::Apt::state ( const std::string &  pkg) const

◆ timestamp()

time_t ept::apt::Apt::timestamp ( )

Timestamp of when the apt index was last modified.

Referenced by checkCacheUpdates(), and register_tests().

◆ validate() [1/2]

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 ept::axi::timestamp().

Referenced by register_tests().

◆ validate() [2/2]

Version ept::apt::Apt::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.

References impl, ept::apt::Version::name(), and ept::apt::Version::version().

Member Data Documentation

◆ impl

AptImplementation* ept::apt::Apt::impl
protected

The documentation for this class was generated from the following files: