libept
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ept::debtags::Debtags Class Reference

Access the on-disk Debtags tag database. More...

#include <debtags.h>

Inheritance diagram for ept::debtags::Debtags:

Public Types

typedef tagcoll::coll::Fast< std::string, std::string > coll_type
 
typedef std::pair< std::string, std::set< std::string > > value_type
 

Public Member Functions

 Debtags ()
 Create a Debtags object, reading the system database. More...
 
 Debtags (const std::string &pathname)
 Create a Debtags object, reading the given database file. More...
 
 ~Debtags ()
 
time_t timestamp () const
 Get the timestamp of when the index was last updated. More...
 
bool hasData () const
 Return true if this data source has data, false if it's empty. More...
 
coll_typetagdb ()
 
const coll_typetagdb () const
 

Static Public Member Functions

static std::string pathname ()
 Return the default pathname for the debtags tags. More...
 

Protected Member Functions

void load (const std::string &pathname)
 

Protected Attributes

std::string rcdir
 
time_t m_timestamp
 

Detailed Description

Access the on-disk Debtags tag database.

The database is normally found in /var/lib/debtags.

Tags and Facets are returned as std::strings. The objects follow the flyweight pattern and access the data contained in the Vocabulary instantiated inside Debtags.

It is possible to get a reference to the Vocabulary object using the vocabulary() method.

Member Typedef Documentation

typedef tagcoll::coll::Fast<std::string, std::string> ept::debtags::Debtags::coll_type
typedef std::pair< std::string, std::set<std::string> > ept::debtags::Debtags::value_type

Constructor & Destructor Documentation

ept::debtags::Debtags::Debtags ( )

Create a Debtags object, reading the system database.

References load(), and pathname().

ept::debtags::Debtags::Debtags ( const std::string &  pathname)

Create a Debtags object, reading the given database file.

References load().

ept::debtags::Debtags::~Debtags ( )
inline

Member Function Documentation

bool ept::debtags::Debtags::hasData ( ) const
inline

Return true if this data source has data, false if it's empty.

Referenced by TestDebtags::_4().

void ept::debtags::Debtags::load ( const std::string &  pathname)
protected

References m_timestamp, and ept::axi::timestamp().

Referenced by Debtags().

string ept::debtags::Debtags::pathname ( )
static

Return the default pathname for the debtags tags.

This returns /var/lib/debtags/package-tags, unless it has been overridden by setting $DEBTAGS_TAGS

References res.

Referenced by Debtags().

coll_type& ept::debtags::Debtags::tagdb ( )
inline
const coll_type& ept::debtags::Debtags::tagdb ( ) const
inline
time_t ept::debtags::Debtags::timestamp ( ) const
inline

Get the timestamp of when the index was last updated.

References m_timestamp.

Referenced by TestDebtags::_4().

Member Data Documentation

time_t ept::debtags::Debtags::m_timestamp
protected

Referenced by load(), and timestamp().

std::string ept::debtags::Debtags::rcdir
protected

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