libept
|
Access the on-disk Debtags tag database. More...
#include <debtags.h>
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 (bool editable=false) | |
Create a new accessor for the on-disk Debtags database. | |
~Debtags () | |
time_t | timestamp () const |
Get the timestamp of when the index was last updated. | |
bool | hasData () const |
Return true if this data source has data, false if it's empty. | |
coll_type & | tagdb () |
const coll_type & | tagdb () const |
tagcoll::PatchList < std::string, std::string > | changes () const |
void | savePatch () |
Check if the tag database has been created (i.e. | |
void | savePatch (const tagcoll::PatchList< std::string, std::string > &patch) |
Save in the state storage directory a patch to turn the system database into the collection given. | |
void | sendPatch () |
Send to the central archive a patch that can be used to turn the system database into the collection given. | |
void | sendPatch (const tagcoll::PatchList< std::string, std::string > &patch) |
Send the given patch to the central archive. | |
template<typename OUT > | |
void | outputSystem (const OUT &cons) |
Output the current Debian tags database to a consumer of <std::string, std::string> | |
template<typename OUT > | |
void | outputSystem (const std::string &filename, const OUT &out) |
Output the given tag file to a consumer of <std::string, std::string> | |
template<typename OUT > | |
void | outputPatched (const OUT &cons) |
Output the current Debian tags database, patched with local patch, to a Consumer of <std::string, std::string> | |
template<typename OUT > | |
void | outputPatched (const std::string &filename, const OUT &out) |
Output the given tag file, patched with local patch, to a Consumer of <std::string, std::string> | |
Protected Attributes | |
std::string | rcdir |
time_t | m_timestamp |
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 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 |
ept::debtags::Debtags::Debtags | ( | bool | editable = false | ) |
Create a new accessor for the on-disk Debtags database.
editable | Specifies if recording of modifications should be enabled. If editable is true, then the local state directory will be created when the object is instantiated. |
References ept::debtags::SourceDir::readTags(), and ept::debtags::SourceDir::tagTimestamp().
ept::debtags::Debtags::~Debtags | ( | ) | [inline] |
tagcoll::PatchList< std::string, std::string > ept::debtags::Debtags::changes | ( | ) | const |
References ept::debtags::SourceDir::readTags().
Referenced by TestDebtags::_5().
bool ept::debtags::Debtags::hasData | ( | ) | const [inline] |
Return true if this data source has data, false if it's empty.
References m_timestamp.
Referenced by TestDebtags::_5().
void ept::debtags::Debtags::outputPatched | ( | const OUT & | cons | ) |
Output the current Debian tags database, patched with local patch, to a Consumer of <std::string, std::string>
Referenced by TestDebtags::_5().
void ept::debtags::Debtags::outputPatched | ( | const std::string & | filename, |
const OUT & | out | ||
) |
Output the given tag file, patched with local patch, to a Consumer of <std::string, std::string>
void ept::debtags::Debtags::outputSystem | ( | const OUT & | cons | ) |
Output the current Debian tags database to a consumer of <std::string, std::string>
Referenced by TestDebtags::_5().
void ept::debtags::Debtags::outputSystem | ( | const std::string & | filename, |
const OUT & | out | ||
) |
Output the given tag file to a consumer of <std::string, std::string>
void ept::debtags::Debtags::savePatch | ( | ) |
Check if the tag database has been created (i.e.
if something equivalend to debtags update has been run) Save in the state storage directory a patch that can be used to turn the system database into the collection given
void ept::debtags::Debtags::savePatch | ( | const tagcoll::PatchList< std::string, std::string > & | patch | ) |
Save in the state storage directory a patch to turn the system database into the collection given.
void ept::debtags::Debtags::sendPatch | ( | const tagcoll::PatchList< std::string, std::string > & | patch | ) |
Send the given patch to the central archive.
void ept::debtags::Debtags::sendPatch | ( | ) |
Send to the central archive a patch that can be used to turn the system database into the collection given.
const coll_type& ept::debtags::Debtags::tagdb | ( | ) | const [inline] |
coll_type& ept::debtags::Debtags::tagdb | ( | ) | [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::_5().
time_t ept::debtags::Debtags::m_timestamp [protected] |
Referenced by hasData(), and timestamp().
std::string ept::debtags::Debtags::rcdir [protected] |