Cupt
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes
cupt::Cache Class Reference

the source of package and version information More...

#include <cupt/cache.hpp>

List of all members.

Classes

struct  ExtendedInfo
 extended package information More...
struct  IndexDownloadRecord
struct  IndexEntry
 describes smallest index source piece More...
struct  LocalizationDownloadRecord
struct  PinnedVersion
 contains version and a corresponding pin value More...

Public Member Functions

 Cache (shared_ptr< const Config > config, bool useSource, bool useBinary, bool useInstalled, const vector< string > &packageNameGlobsToReinstall=vector< string >())
 constructor
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
vector< string > getBinaryPackageNames () const
 gets the list of names of available binary packages
shared_ptr< const BinaryPackagegetBinaryPackage (const string &packageName) const
 gets BinaryPackage by name
vector< string > getSourcePackageNames () const
 gets the list of names of available source packages
shared_ptr< const SourcePackagegetSourcePackage (const string &packageName) const
 gets SourcePackage by name
vector< shared_ptr< const
BinaryVersion > > 
getInstalledVersions () const
 gets all installed versions
bool isAutomaticallyInstalled (const string &packageName) const
 is binary package automatically installed?
vector< IndexEntrygetIndexEntries () const
 gets list of available index entries
string getPathOfReleaseList (const IndexEntry &entry) const
string getPathOfIndexList (const IndexEntry &entry) const
string getPathOfExtendedStates () const
string getDownloadUriOfReleaseList (const IndexEntry &) const
vector< IndexDownloadRecordgetDownloadInfoOfIndexList (const IndexEntry &) const
vector
< LocalizationDownloadRecord
getDownloadInfoOfLocalizedDescriptions (const IndexEntry &) const
shared_ptr< const system::StategetSystemState () const
 gets system state
ssize_t getPin (const shared_ptr< const Version > &) const
 gets pin value for a version
vector< PinnedVersiongetSortedPinnedVersions (const shared_ptr< const Package > &) const
 gets list of versions with pins of certain package
shared_ptr< const VersiongetPolicyVersion (const shared_ptr< const Package > &) const
 gets version of highest pin from the package
vector< shared_ptr< const
BinaryVersion > > 
getSatisfyingVersions (const RelationExpression &) const
 gets list of binary versions which satisfy given relation expression
const ExtendedInfogetExtendedInfo () const
 gets extended info
pair< string, string > getLocalizedDescriptions (const shared_ptr< const BinaryVersion > &) const
 gets localized short and long descriptions for the binary version

Static Public Member Functions

static bool verifySignature (const shared_ptr< const Config > &, const string &path)
static string getPathOfCopyright (const shared_ptr< const BinaryVersion > &)
 gets a supposed system path of package copyright file for certain binary version
static string getPathOfChangelog (const shared_ptr< const BinaryVersion > &)
 gets a supposed system path of package changelog file for certain binary version

Static Public Attributes

static bool memoize
 controls internal caching

Detailed Description

the source of package and version information


Constructor & Destructor Documentation

cupt::Cache::Cache ( shared_ptr< const Config config,
bool  useSource,
bool  useBinary,
bool  useInstalled,
const vector< string > &  packageNameGlobsToReinstall = vector< string >() 
)

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)
packageNameGlobsToReinstallarray of glob expressions, allow these packages to be re-installed

Member Function Documentation

shared_ptr< 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
Deprecated:
an internal method, should not be used
Deprecated:
an internal method, should not be used
Deprecated:
an internal method, should not be used
pair< string, string > cupt::Cache::getLocalizedDescriptions ( const shared_ptr< const BinaryVersion > &  ) const

gets localized short and long descriptions for the binary version

Returns:
first pair element - short description, long pair element - long description; if localized descriptions are not available, short description will be empty
static string cupt::Cache::getPathOfChangelog ( const shared_ptr< 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.

static string cupt::Cache::getPathOfCopyright ( const shared_ptr< 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.

Deprecated:
an internal method, should not be used
string cupt::Cache::getPathOfIndexList ( const IndexEntry entry) const
Deprecated:
an internal method, should not be used
string cupt::Cache::getPathOfReleaseList ( const IndexEntry entry) const
Deprecated:
an internal method, should not be used
shared_ptr< 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
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
static bool cupt::Cache::verifySignature ( const shared_ptr< const Config > &  ,
const string &  path 
) [static]
Deprecated:
an internal method, should not be used

Member Data Documentation

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: