libept
0.5.25
|
Maps Packages to IDs and vice-versa. More...
#include <pkgid.h>
Public Member Functions | |
PkgId () | |
PkgId (const tagcoll::diskindex::MasterMMap &master, size_t idx) | |
PkgId (const char *buf, int size) | |
time_t | timestamp () const |
Get the timestamp of when the index was last updated. More... | |
size_t | size () const |
Get the number of packages in the index. More... | |
int | byName (const std::string &name) const |
Get the ID of a package given its name. More... | |
std::string | byID (int id) const |
Get a package name given its ID. More... | |
int | size (int id) const |
Get the number of packages in the index. More... | |
Maps Packages to IDs and vice-versa.
This is used in building the Debtags fast index, which works representing tags and packages as int IDs
ept::debtags::PkgId::PkgId | ( | ) |
ept::debtags::PkgId::PkgId | ( | const tagcoll::diskindex::MasterMMap & | master, |
size_t | idx | ||
) |
ept::debtags::PkgId::PkgId | ( | const char * | buf, |
int | size | ||
) |
|
inline |
Get a package name given its ID.
If not found, returns the empty string.
References size().
Referenced by TestPkgid::_1(), byName(), ept::debtags::IntToPkg< OUT >::operator=(), ept::debtags::PatchIntToString< OUT >::operator=(), and ept::debtags::Debtags::packageByID().
int ept::debtags::PkgId::byName | ( | const std::string & | name | ) | const |
Get the ID of a package given its name.
If not found, returns -1.
References byID(), and size().
Referenced by TestPkgid::_1(), TestPkgid::_2(), ept::debtags::Debtags::idByPackage(), ept::debtags::StringToInt< OUT >::operator=(), ept::debtags::StringToPkg< OUT >::operator=(), and ept::debtags::PatchStringToInt< OUT >::operator=().
|
inline |
|
inline |
Get the number of packages in the index.
References size().
|
inline |
Get the timestamp of when the index was last updated.