Deepsolver
|
The general interface to librpm functions. More...
Public Member Functions | |
std::auto_ptr < AbstractInstalledPackagesIterator > | enumInstalledPackages () const |
Creates an instance of an iterator over the set of installed packages. | |
void | initialize () |
Prepares package back-end for any operations. | |
void | readPackageFile (const std::string &fileName, PkgFile &pkgFile) const |
Reads header information from package file on disk. | |
RpmBackEnd () | |
The default constructor. | |
bool | validPkgFileName (const std::string &fileName) const |
Checks if provided file name is a proper package name. | |
bool | validSourcePkgFileName (const std::string &fileName) const |
Checks if provided file name is a proper source package name. | |
int | versionCompare (const std::string &ver1, const std::string &ver2) const |
Compares two version strings. | |
bool | versionEqual (const std::string &ver1, const std::string &ver2) const |
Compares two version values for equality. | |
bool | versionGreater (const std::string &ver1, const std::string &ver2) const |
Checks if one version is newer than another. | |
bool | versionOverlap (const VersionCond &ver1, const VersionCond &ver2) const |
Overlaps two version ranges. | |
virtual | ~RpmBackEnd () |
The destructor. |
This class covers all functions of librpm needed for proper Deepsolver work. Since Deepsolver purposed by design as universal package manager all package libraries should be used through an abstraction layer represented by AbstractPackageBackEnd class. Be careful, even with abstraction layer user can face compatibility problems due to differences in details implementation.
std::auto_ptr< AbstractInstalledPackagesIterator > RpmBackEnd::enumInstalledPackages | ( | ) | const [virtual] |
Use this method to get the complete list of packages currently installed in the user system. Since iteration process is very back-end specific the iterator is also provided by abstract interface as back-end object itself.
Implements AbstractPackageBackEnd.
void RpmBackEnd::initialize | ( | ) | [virtual] |
This method should be called before performing any operations with particular package library. For safety reasons it is assumed invocation is needed for every created instance of the back-end but actually it is not always so. For example in case of RpmBackEnd this method may be called only once with any instance.
Implements AbstractPackageBackEnd.
void RpmBackEnd::readPackageFile | ( | const std::string & | fileName, |
PkgFile & | pkgFile | ||
) | const [virtual] |
This method reads header data from package file on dist using corresponding functions of an particular package library. Retrieved data is saved in the instance of the universal package class PkgFile.
[in] | fileName | The name of the file to read data from |
[out] | pkgFile | The object to save retrieved data in |
Implements AbstractPackageBackEnd.
bool RpmBackEnd::validPkgFileName | ( | const std::string & | fileName | ) | const [virtual] |
Use this method to check package file extension.
[in] | fileName | The file name to check |
Implements AbstractPackageBackEnd.
bool RpmBackEnd::validSourcePkgFileName | ( | const std::string & | fileName | ) | const [virtual] |
Use this method to check source package file extension.
[in] | fileName | The file name to check |
Implements AbstractPackageBackEnd.
int RpmBackEnd::versionCompare | ( | const std::string & | ver1, |
const std::string & | ver2 | ||
) | const [virtual] |
This method compares two version values and returns an integer value reflecting its relation.
[in] | ver1 | The first version value to compare |
[in] | ver2 | The second version value to compare |
Implements AbstractPackageBackEnd.
bool RpmBackEnd::versionEqual | ( | const std::string & | ver1, |
const std::string & | ver2 | ||
) | const [virtual] |
This method checks two strings designate same version value.
[in] | ver1 | The first string to compare |
[in] | ver2 | The second string to compare |
Implements AbstractPackageBackEnd.
bool RpmBackEnd::versionGreater | ( | const std::string & | ver1, |
const std::string & | ver2 | ||
) | const [virtual] |
This method checks one version string designates version value newer than another.
[in] | ver1 | The first string to compare |
[in] | ver2 | The second string to compare |
Implements AbstractPackageBackEnd.
bool RpmBackEnd::versionOverlap | ( | const VersionCond & | ver1, |
const VersionCond & | ver2 | ||
) | const [virtual] |
This method is not symmetric. If second version range has no epoch indication it assumes the same as in first one if there any. So if this method is used for requires processing the require entry should go only as second argument.
[in] | ver1 | The first version range to intersect |
[in] | ver2 | The second version range to intersect |
Implements AbstractPackageBackEnd.