libept
0.5.25
Main Page
Namespaces
Classes
Files
File List
File Members
ept
debtags
maint
vocabularyindexer.h
Go to the documentation of this file.
1
#ifndef EPT_DEBTAGS_VOCABULARYINDEXER_H
2
#define EPT_DEBTAGS_VOCABULARYINDEXER_H
3
9
/*
10
* Copyright (C) 2003,2004,2005,2006,2007 Enrico Zini <enrico@debian.org>
11
*
12
* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 2 of the License, or
15
* (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
*/
26
27
#include <
ept/debtags/maint/sourcedir.h
>
28
#include <string>
29
30
namespace
ept
{
31
namespace
debtags {
32
36
struct
VocabularyIndexer
37
{
38
SourceDir
mainSource
;
39
SourceDir
userSource
;
40
time_t
ts_main_src
;
41
time_t
ts_user_src
;
42
time_t
ts_main_voc
;
43
time_t
ts_main_idx
;
44
time_t
ts_user_voc
;
45
time_t
ts_user_idx
;
46
50
time_t
sourceTimestamp
()
const
{
return
ts_main_src < ts_user_src ? ts_user_src :
ts_main_src
; }
54
bool
needsRebuild
()
const
;
55
63
bool
rebuild
(
const
std::string& vocfname,
const
std::string& idxfname);
64
68
bool
rebuildIfNeeded
();
69
77
bool
getUpToDateVocabulary
(std::string& vocfname, std::string& idxfname);
78
85
bool
userIndexIsRedundant
()
const
;
86
90
bool
deleteRedundantUserIndex
();
91
95
void
rescan
();
96
97
VocabularyIndexer
();
98
108
static
bool
obtainWorkingVocabulary
(std::string& vocfname, std::string& idxfname);
109
};
110
111
112
}
113
}
114
115
// vim:set ts=4 sw=4:
116
#endif
ept::debtags::VocabularyIndexer::rebuildIfNeeded
bool rebuildIfNeeded()
Rebuild the vocabulary if needed.
Definition:
vocabularyindexer.cc:104
ept::debtags::VocabularyIndexer::deleteRedundantUserIndex
bool deleteRedundantUserIndex()
Deletes the user index if it is redundant.
Definition:
vocabularyindexer.cc:135
sourcedir.h
ept::debtags::VocabularyIndexer::rebuild
bool rebuild(const std::string &vocfname, const std::string &idxfname)
Rebuild the vocabulary index.
Definition:
vocabularyindexer.cc:70
ept::debtags::VocabularyIndexer::ts_main_idx
time_t ts_main_idx
Definition:
vocabularyindexer.h:43
ept::debtags::VocabularyIndexer::userIndexIsRedundant
bool userIndexIsRedundant() const
Returns true if the index in the user home directory is redundant and can be deleted.
Definition:
vocabularyindexer.cc:52
ept::debtags::VocabularyIndexer::mainSource
SourceDir mainSource
Definition:
vocabularyindexer.h:38
ept::debtags::VocabularyIndexer::ts_main_src
time_t ts_main_src
Definition:
vocabularyindexer.h:40
ept
-*- C++ -*- (c) 2006, 2007 Petr Rockai me@mornfall.net
Definition:
apt.cc:43
ept::debtags::VocabularyIndexer::sourceTimestamp
time_t sourceTimestamp() const
Get the timestamp of the newest vocabulary data source.
Definition:
vocabularyindexer.h:50
ept::debtags::VocabularyIndexer::ts_user_src
time_t ts_user_src
Definition:
vocabularyindexer.h:41
ept::debtags::VocabularyIndexer::needsRebuild
bool needsRebuild() const
Return true if the vocabulary index needs rebuilding.
Definition:
vocabularyindexer.cc:28
ept::debtags::SourceDir
Access a directory containing Debtags data files.
Definition:
debtags/maint/sourcedir.h:38
ept::debtags::VocabularyIndexer::rescan
void rescan()
Rescan the various timestamps.
Definition:
vocabularyindexer.cc:18
ept::debtags::VocabularyIndexer::ts_user_voc
time_t ts_user_voc
Definition:
vocabularyindexer.h:44
ept::debtags::VocabularyIndexer::userSource
SourceDir userSource
Definition:
vocabularyindexer.h:39
ept::debtags::VocabularyIndexer::getUpToDateVocabulary
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 vocabu...
Definition:
vocabularyindexer.cc:155
ept::debtags::VocabularyIndexer::ts_main_voc
time_t ts_main_voc
Definition:
vocabularyindexer.h:42
ept::debtags::VocabularyIndexer
Infrastructure used to rebuild the vocabulary index when needed.
Definition:
vocabularyindexer.h:36
ept::debtags::VocabularyIndexer::obtainWorkingVocabulary
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 vocabu...
Definition:
vocabularyindexer.cc:188
ept::debtags::VocabularyIndexer::VocabularyIndexer
VocabularyIndexer()
Definition:
vocabularyindexer.cc:12
ept::debtags::VocabularyIndexer::ts_user_idx
time_t ts_user_idx
Definition:
vocabularyindexer.h:45
Generated by
1.8.11