libept
|
00001 #ifndef EPT_DEBTAGS_DEBTAGSINDEXER_H 00002 #define EPT_DEBTAGS_DEBTAGSINDEXER_H 00003 00004 #include <ept/debtags/maint/sourcedir.h> 00005 #include <string> 00006 00007 namespace ept { 00008 namespace debtags { 00009 00010 class Vocabulary; 00011 00012 struct DebtagsIndexer 00013 { 00014 Vocabulary& voc; 00015 00016 SourceDir mainSource; 00017 SourceDir userSource; 00018 time_t ts_main_src; 00019 time_t ts_user_src; 00020 time_t ts_main_tag; 00021 time_t ts_main_idx; 00022 time_t ts_user_tag; 00023 time_t ts_user_idx; 00024 00025 time_t sourceTimestamp() const 00026 { 00027 time_t res = ts_main_src; 00028 if (ts_user_src > res) res = ts_user_src; 00029 return res; 00030 } 00031 bool needsRebuild() const; 00032 bool rebuild(const std::string& tagfname, const std::string& idxfname); 00033 bool rebuildIfNeeded(); 00034 bool getUpToDateTagdb(std::string& tagfname, std::string& idxfname); 00035 00036 bool userIndexIsRedundant() const; 00037 bool deleteRedundantUserIndex(); 00038 00039 void rescan(); 00040 00041 DebtagsIndexer(Vocabulary& voc); 00042 00043 static bool obtainWorkingDebtags(Vocabulary& voc, std::string& tagfname, std::string& idxfname); 00044 }; 00045 00046 00047 } 00048 } 00049 00050 // vim:set ts=4 sw=4: 00051 #endif