libept  0.5.25
Public Member Functions | List of all members
ept::debtags::PkgId Class Reference

Maps Packages to IDs and vice-versa. More...

#include <pkgid.h>

Inheritance diagram for ept::debtags::PkgId:
Inheritance graph
[legend]
Collaboration diagram for ept::debtags::PkgId:
Collaboration graph
[legend]

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...
 

Detailed Description

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

Constructor & Destructor Documentation

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 
)

Member Function Documentation

std::string ept::debtags::PkgId::byID ( int  id) const
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
size_t ept::debtags::PkgId::size ( ) const
inline

Get the number of packages in the index.

References byName().

Referenced by byID(), byName(), and size().

int ept::debtags::PkgId::size ( int  id) const
inline

Get the number of packages in the index.

References size().

time_t ept::debtags::PkgId::timestamp ( ) const
inline

Get the timestamp of when the index was last updated.


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