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

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_typetagdb ()
const coll_typetagdb () 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

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 ( bool  editable = false)

Create a new accessor for the on-disk Debtags database.

Parameters
editableSpecifies 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

Member Function Documentation

tagcoll::PatchList< std::string, std::string > ept::debtags::Debtags::changes ( ) const
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().

template<typename OUT >
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>

Note
The collection is sent to 'cons' without merging repeated items

Referenced by TestDebtags::_5().

template<typename OUT >
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>

Note
The collection is sent to 'cons' without merging repeated items
template<typename OUT >
void ept::debtags::Debtags::outputSystem ( const OUT &  cons)

Output the current Debian tags database to a consumer of <std::string, std::string>

Note
The collection is sent to 'cons' without merging repeated items

Referenced by TestDebtags::_5().

template<typename OUT >
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>

Note
The collection is sent to 'cons' without merging repeated items
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 ( )

Send to the central archive a patch that can be used 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.

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::_5().

Member Data Documentation

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

Referenced by hasData(), and timestamp().

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

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