Cupt
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
cupt::Cache Class Reference

the source of package and version information More...

#include <cupt/cache.hpp>

Classes

struct  ExtendedInfo
 extended package information More...
 
struct  IndexEntry
 describes smallest index source piece More...
 
class  PackageNameIterator
 
struct  VersionWithPriority
 contains version and its corresponding priority More...
 

Public Member Functions

 Cache (shared_ptr< const Config > config, bool useSource, bool useBinary, bool useInstalled)
 constructor More...
 
virtual ~Cache ()
 destructor
 
vector< shared_ptr< const ReleaseInfo > > getBinaryReleaseData () const
 gets release data list of indexed metadata for binary packages
 
vector< shared_ptr< const ReleaseInfo > > getSourceReleaseData () const
 gets release data list of indexed metadata for source packages
 
Range< PackageNameIteratorgetBinaryPackageNames () const
 gets the list of names of available binary packages
 
const BinaryPackagegetBinaryPackage (const string &packageName) const
 gets BinaryPackage by name More...
 
Range< PackageNameIteratorgetSourcePackageNames () const
 gets the list of names of available source packages
 
const SourcePackagegetSourcePackage (const string &packageName) const
 gets SourcePackage by name More...
 
vector< const BinaryVersion * > getInstalledVersions () const
 gets all installed versions
 
bool isAutomaticallyInstalled (const string &packageName) const
 is binary package automatically installed? More...
 
vector< IndexEntrygetIndexEntries () const
 gets list of available index entries
 
const system::StategetSystemState () const
 gets system state
 
ssize_t getPin (const Version *) const
 gets pin value for a version
 
vector< VersionWithPrioritygetSortedVersionsWithPriorities (const Package *) const
 gets list of versions with priorities of certain package
 
const VersiongetPreferredVersion (const Package *) const
 gets version of highest pin from the package
 
vector< const BinaryVersion * > getSatisfyingVersions (const RelationExpression &) const
 gets list of binary versions which satisfy given relation expression
 
const ExtendedInfogetExtendedInfo () const
 gets extended info
 
string getLocalizedDescription (const BinaryVersion *) const
 gets localized description for the binary version More...
 

Static Public Member Functions

static string getPathOfCopyright (const BinaryVersion *)
 gets a supposed system path of package copyright file for certain binary version More...
 
static string getPathOfChangelog (const BinaryVersion *)
 gets a supposed system path of package changelog file for certain binary version More...
 

Static Public Attributes

static bool memoize
 controls internal caching More...
 

Detailed Description

the source of package and version information

Constructor & Destructor Documentation

◆ Cache()

cupt::Cache::Cache ( shared_ptr< const Config config,
bool  useSource,
bool  useBinary,
bool  useInstalled 
)

constructor

Reads package metadata and builds index on it.

Parameters
config
useSourcewhether to read source package metadata
useBinarywhether to read binary package metadata
useInstalledwhether to read dpkg metadata (installed binary packages)

Member Function Documentation

◆ getBinaryPackage()

const BinaryPackage* cupt::Cache::getBinaryPackage ( const string &  packageName) const

gets BinaryPackage by name

Parameters
packageNamename of the binary package
Returns
pointer to binary package if found, empty pointer if not

◆ getLocalizedDescription()

string cupt::Cache::getLocalizedDescription ( const BinaryVersion ) const

gets localized description for the binary version

Returns
localized description if available, version description otherwise

◆ getPathOfChangelog()

static string cupt::Cache::getPathOfChangelog ( const BinaryVersion )
static

gets a supposed system path of package changelog file for certain binary version

You must not assume that the file actually exists even if installed version is passed as parameter.

◆ getPathOfCopyright()

static string cupt::Cache::getPathOfCopyright ( const BinaryVersion )
static

gets a supposed system path of package copyright file for certain binary version

You must not assume that the file actually exists even if installed version is passed as parameter.

◆ getSourcePackage()

const SourcePackage* cupt::Cache::getSourcePackage ( const string &  packageName) const

gets SourcePackage by name

Parameters
packageNamename of the source package
Returns
pointer to source package if found, empty pointer if not

◆ isAutomaticallyInstalled()

bool cupt::Cache::isAutomaticallyInstalled ( const string &  packageName) const

is binary package automatically installed?

Parameters
packageNamename of the binary package
Returns
true if yes, false if no

Member Data Documentation

◆ memoize

bool cupt::Cache::memoize
static

controls internal caching

If set to true, enables internal caching in methods getPin and getSatisfyingVersions. Defaults to false.


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