libept
|
Access the on-disk Debtags tag database. More...
#include <debtags.h>
Public Types | |
typedef ept::debtags::coll::Fast | coll_type |
typedef std::pair< std::string, std::set< std::string > > | value_type |
![]() | |
typedef std::map< std::string, std::set< std::string > >::const_iterator | const_iterator |
typedef std::map< std::string, std::set< std::string > >::iterator | iterator |
typedef std::map< std::string, std::set< std::string > >::value_type | value_type |
typedef std::map< std::string, std::set< std::string > >::const_iterator | const_tag_iterator |
typedef std::map< std::string, std::set< std::string > >::iterator | tag_iterator |
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_type & | tagdb () |
const coll_type & | tagdb () const |
![]() | |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
const_tag_iterator | tagBegin () const |
const_tag_iterator | tagEnd () const |
tag_iterator | tagBegin () |
tag_iterator | tagEnd () |
void | insert (const std::string &item, const std::set< std::string > &tags) |
void | insert (const std::set< std::string > &items, const std::string &tag) |
void | insert (const std::set< std::string > &items, const std::set< std::string > &tags) |
void | clear () |
std::set< std::string > | getTagsOfItem (const std::string &item) const |
std::set< std::string > | getItemsHavingTag (const std::string &tag) const |
std::set< std::string > | getItemsHavingTags (const std::set< std::string > &tags) const |
Get the items which are tagged with at least the tags `tags'. More... | |
bool | empty () const |
bool | hasItem (const std::string &item) const |
bool | hasTag (const std::string &tag) const |
std::set< std::string > | getTaggedItems () const |
std::set< std::string > | getAllTags () const |
std::vector< std::string > | getAllTagsAsVector () const |
unsigned int | itemCount () const |
unsigned int | tagCount () const |
std::set< std::string > | getTagsImplying (const std::string &tag) const |
std::set< std::string > | getItemsExactMatch (const std::set< std::string > &tags) const |
std::string | findTagWithMaxCardinality (size_t &card) const |
Fast | getChildCollection (const std::string &tag) const |
Return the collection with only those items that have this tag, but with the given tag removed. More... | |
void | removeTag (const std::string &tag) |
void | removeTagsWithCardinalityLessThan (size_t card) |
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 |
![]() | |
std::map< std::string, std::set< std::string > > | items |
std::map< std::string, std::set< std::string > > | tags |
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.
typedef std::pair< std::string, std::set<std::string> > ept::debtags::Debtags::value_type |
ept::debtags::Debtags::Debtags | ( | ) |
Create a Debtags object, reading the system database.
References ept::sys::exists(), load(), and pathname().
ept::debtags::Debtags::Debtags | ( | const std::string & | pathname | ) |
|
inline |
|
inline |
Return true if this data source has data, false if it's empty.
|
protected |
References m_timestamp, ept::debtags::coll::textformat::parse(), and ept::sys::timestamp().
Referenced by Debtags().
|
static |
|
inline |
|
inline |
References pathname().
|
inline |
Get the timestamp of when the index was last updated.
References m_timestamp.
|
protected |
Referenced by load(), and timestamp().
|
protected |