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
Generated on Tue Apr 7 2020 14:42:12 for libept by
1.8.1.2