#include <vocabularyindexer.h>
Public Member Functions | |
time_t | sourceTimestamp () const |
Get the timestamp of the newest vocabulary data source. | |
bool | needsRebuild () const |
Return true if the vocabulary index needs rebuilding. | |
bool | rebuild (const std::string &vocfname, const std::string &idxfname) |
Rebuild the vocabulary index. | |
bool | rebuildIfNeeded () |
Rebuild the vocabulary if needed. | |
bool | getUpToDateVocabulary (std::string &vocfname, std::string &idxfname) |
Get the names of the merged vocabulary and vocabulary index that can be used to access Debtags vocabulary data. | |
bool | userIndexIsRedundant () const |
Returns true if the index in the user home directory is redundant and can be deleted. | |
bool | deleteRedundantUserIndex () |
Deletes the user index if it is redundant. | |
void | rescan () |
Rescan the various timestamps. | |
VocabularyIndexer () | |
Static Public Member Functions | |
static bool | obtainWorkingVocabulary (std::string &vocfname, std::string &idxfname) |
Get the names of the merged vocabulary and vocabulary index that can be used to access Debtags vocabulary data. | |
Public Attributes | |
SourceDir | mainSource |
SourceDir | userSource |
time_t | ts_main_src |
time_t | ts_user_src |
time_t | ts_main_voc |
time_t | ts_main_idx |
time_t | ts_user_voc |
time_t | ts_user_idx |
ept::debtags::VocabularyIndexer::VocabularyIndexer | ( | ) |
time_t ept::debtags::VocabularyIndexer::sourceTimestamp | ( | ) | const [inline] |
Get the timestamp of the newest vocabulary data source.
bool ept::debtags::VocabularyIndexer::needsRebuild | ( | ) | const |
Return true if the vocabulary index needs rebuilding.
bool ept::debtags::VocabularyIndexer::rebuild | ( | const std::string & | vocfname, | |
const std::string & | idxfname | |||
) |
Rebuild the vocabulary index.
vocfname | Full pathname of the merged vocabulary to create | |
idxfname | Full pathname of the vocabulary index to create |
bool ept::debtags::VocabularyIndexer::rebuildIfNeeded | ( | ) |
Rebuild the vocabulary if needed.
bool ept::debtags::VocabularyIndexer::getUpToDateVocabulary | ( | std::string & | vocfname, | |
std::string & | idxfname | |||
) |
Get the names of the merged vocabulary and vocabulary index that can be used to access Debtags vocabulary data.
The system or the user index will be returned according to which one is up to date.
bool ept::debtags::VocabularyIndexer::userIndexIsRedundant | ( | ) | const |
Returns true if the index in the user home directory is redundant and can be deleted.
The user index is redundant if the system index is up to date.
bool ept::debtags::VocabularyIndexer::deleteRedundantUserIndex | ( | ) |
Deletes the user index if it is redundant.
void ept::debtags::VocabularyIndexer::rescan | ( | ) |
Rescan the various timestamps.
bool ept::debtags::VocabularyIndexer::obtainWorkingVocabulary | ( | std::string & | vocfname, | |
std::string & | idxfname | |||
) | [static] |
Get the names of the merged vocabulary and vocabulary index that can be used to access Debtags vocabulary data.
The system or the user index will be returned according to which one is up to date.
The files will be built or rebuilt if they are missing or outdated.