ept::debtags::PkgId Class Reference

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

#include <pkgid.h>

List of all members.

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.
size_t size () const
 Get the number of packages in the index.
int byName (const std::string &name) const
 Get the ID of a package given its name.
std::string byID (int id) const
 Get a package name given its ID.
int size (int id) const
 Get the number of packages in the index.


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::PatchIntToString< OUT >::operator=(), ept::debtags::IntToPkg< OUT >::operator=(), and ept::debtags::Debtags::packageByID().

int ept::debtags::PkgId::byName ( const std::string &  name  )  const

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

Get the number of packages in the index.

References size().

size_t ept::debtags::PkgId::size (  )  const [inline]

Get the number of packages in the index.

Referenced by byID(), byName(), and 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:

Generated on Tue Feb 10 11:25:04 2009 for libept by  doxygen 1.5.8