ept::debtags::VocabularyIndexer Struct Reference

#include <vocabularyindexer.h>

Collaboration diagram for ept::debtags::VocabularyIndexer:

Collaboration graph
[legend]

List of all members.


Detailed Description

Infrastructure used to rebuild the vocabulary index when needed.

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

Constructor & Destructor Documentation

ept::debtags::VocabularyIndexer::VocabularyIndexer (  ) 

References rescan().


Member Function Documentation

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::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::rebuild ( const std::string &  vocfname,
const std::string &  idxfname 
)

Rebuild the vocabulary index.

Parameters:
vocfname Full pathname of the merged vocabulary to create
idxfname Full pathname of the vocabulary index to create

References ept::debtags::VocabularyMerger::empty(), ept::debtags::VocabularyMerger::facetIndexer(), mainSource, ept::debtags::SourceDir::readVocabularies(), ept::debtags::VocabularyMerger::tagIndexer(), userSource, and ept::debtags::VocabularyMerger::write().

Referenced by rebuildIfNeeded().

bool ept::debtags::VocabularyIndexer::rebuildIfNeeded (  ) 

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

bool ept::debtags::VocabularyIndexer::deleteRedundantUserIndex (  ) 

void ept::debtags::VocabularyIndexer::rescan (  ) 

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


Member Data Documentation

Referenced by rebuild(), and rescan().

Referenced by rebuild(), and rescan().

Referenced by rescan(), and sourceTimestamp().


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

Generated on Sat Jul 26 14:10:45 2008 for libept by  doxygen 1.5.6