libept
|
Infrastructure used to rebuild the vocabulary index when needed. More...
#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 |
Infrastructure used to rebuild the vocabulary index when needed.
References rescan().
Deletes the user index if it is redundant.
References ts_user_idx, ts_user_voc, userIndexIsRedundant(), ept::debtags::Path::userVocabulary(), ept::debtags::Path::userVocabularyIndex(), ept::debtags::Path::vocabulary(), and ept::debtags::Path::vocabularyIndex().
Referenced by obtainWorkingVocabulary().
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.
References sourceTimestamp(), ts_main_idx, ts_main_voc, ts_user_idx, ts_user_src, ts_user_voc, ept::debtags::Path::userVocabulary(), ept::debtags::Path::userVocabularyIndex(), ept::debtags::Path::vocabulary(), and ept::debtags::Path::vocabularyIndex().
Referenced by obtainWorkingVocabulary().
bool ept::debtags::VocabularyIndexer::needsRebuild | ( | ) | const |
Return true if the vocabulary index needs rebuilding.
References sourceTimestamp(), ts_main_idx, ts_main_voc, ts_user_idx, ts_user_src, and ts_user_voc.
Referenced by rebuildIfNeeded().
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.
References deleteRedundantUserIndex(), getUpToDateVocabulary(), and rebuildIfNeeded().
Referenced by ept::debtags::Vocabulary::Vocabulary().
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 |
References mainSource, ept::debtags::SourceDir::readVocabularies(), and userSource.
Referenced by rebuildIfNeeded().
Rebuild the vocabulary if needed.
References ept::debtags::Path::access(), ept::debtags::Path::debtagsIndexDir(), needsRebuild(), rebuild(), ept::debtags::Path::timestamp(), ts_main_idx, ts_main_voc, ts_user_idx, ts_user_src, ts_user_voc, ept::debtags::Path::userVocabulary(), ept::debtags::Path::userVocabularyIndex(), ept::debtags::Path::vocabulary(), and ept::debtags::Path::vocabularyIndex().
Referenced by obtainWorkingVocabulary().
Rescan the various timestamps.
References mainSource, ept::debtags::Path::timestamp(), ts_main_idx, ts_main_src, ts_main_voc, ts_user_idx, ts_user_src, ts_user_voc, userSource, ept::debtags::Path::userVocabulary(), ept::debtags::Path::userVocabularyIndex(), ept::debtags::Path::vocabulary(), ept::debtags::Path::vocabularyIndex(), and ept::debtags::SourceDir::vocTimestamp().
Referenced by VocabularyIndexer().
time_t ept::debtags::VocabularyIndexer::sourceTimestamp | ( | ) | const [inline] |
Get the timestamp of the newest vocabulary data source.
References ts_main_src, and ts_user_src.
Referenced by getUpToDateVocabulary(), needsRebuild(), and userIndexIsRedundant().
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.
References sourceTimestamp(), ts_main_idx, ts_main_voc, ts_user_idx, ts_user_src, and ts_user_voc.
Referenced by deleteRedundantUserIndex().
Referenced by getUpToDateVocabulary(), needsRebuild(), rebuildIfNeeded(), rescan(), and userIndexIsRedundant().
Referenced by rescan(), and sourceTimestamp().
Referenced by getUpToDateVocabulary(), needsRebuild(), rebuildIfNeeded(), rescan(), and userIndexIsRedundant().
Referenced by deleteRedundantUserIndex(), getUpToDateVocabulary(), needsRebuild(), rebuildIfNeeded(), rescan(), and userIndexIsRedundant().
Referenced by getUpToDateVocabulary(), needsRebuild(), rebuildIfNeeded(), rescan(), sourceTimestamp(), and userIndexIsRedundant().
Referenced by deleteRedundantUserIndex(), getUpToDateVocabulary(), needsRebuild(), rebuildIfNeeded(), rescan(), and userIndexIsRedundant().