|
Lines 42-56
Link Here
|
| 42 |
|
42 |
|
| 43 |
time_t SourceDir::timestamp() |
43 |
time_t SourceDir::timestamp() |
| 44 |
{ |
44 |
{ |
| 45 |
if (!valid()) return 0; |
45 |
if (!exists()) return 0; |
| 46 |
|
46 |
|
| 47 |
time_t max = 0; |
47 |
time_t max = 0; |
| 48 |
for (const_iterator d = begin(); d != end(); ++d) |
48 |
for (const_iterator d = begin(); d != end(); ++d) |
| 49 |
{ |
49 |
{ |
| 50 |
FileType type = fileType(d->d_name); |
50 |
FileType type = fileType(*d); |
| 51 |
if (type == SKIP) continue; |
51 |
if (type == SKIP) continue; |
| 52 |
|
52 |
|
| 53 |
time_t ts = Path::timestamp(str::joinpath(path(), d->d_name)); |
53 |
time_t ts = Path::timestamp(str::joinpath(path(), *d)); |
| 54 |
if (ts > max) max = ts; |
54 |
if (ts > max) max = ts; |
| 55 |
} |
55 |
} |
| 56 |
|
56 |
|
|
Lines 59-73
Link Here
|
| 59 |
|
59 |
|
| 60 |
time_t SourceDir::vocTimestamp() |
60 |
time_t SourceDir::vocTimestamp() |
| 61 |
{ |
61 |
{ |
| 62 |
if (!valid()) return 0; |
62 |
if (!exists()) return 0; |
| 63 |
|
63 |
|
| 64 |
time_t max = 0; |
64 |
time_t max = 0; |
| 65 |
for (const_iterator d = begin(); d != end(); ++d) |
65 |
for (const_iterator d = begin(); d != end(); ++d) |
| 66 |
{ |
66 |
{ |
| 67 |
FileType type = fileType(d->d_name); |
67 |
FileType type = fileType(*d); |
| 68 |
if (type != VOC and type != VOCGZ) continue; |
68 |
if (type != VOC and type != VOCGZ) continue; |
| 69 |
|
69 |
|
| 70 |
time_t ts = Path::timestamp(str::joinpath(path(), d->d_name)); |
70 |
time_t ts = Path::timestamp(str::joinpath(path(), *d)); |
| 71 |
if (ts > max) max = ts; |
71 |
if (ts > max) max = ts; |
| 72 |
} |
72 |
} |
| 73 |
|
73 |
|
|
Lines 76-90
Link Here
|
| 76 |
|
76 |
|
| 77 |
time_t SourceDir::tagTimestamp() |
77 |
time_t SourceDir::tagTimestamp() |
| 78 |
{ |
78 |
{ |
| 79 |
if (!valid()) return 0; |
79 |
if (!exists()) return 0; |
| 80 |
|
80 |
|
| 81 |
time_t max = 0; |
81 |
time_t max = 0; |
| 82 |
for (const_iterator d = begin(); d != end(); ++d) |
82 |
for (const_iterator d = begin(); d != end(); ++d) |
| 83 |
{ |
83 |
{ |
| 84 |
FileType type = fileType(d->d_name); |
84 |
FileType type = fileType(*d); |
| 85 |
if (type != TAG and type != TAGGZ) continue; |
85 |
if (type != TAG and type != TAGGZ) continue; |
| 86 |
|
86 |
|
| 87 |
time_t ts = Path::timestamp(str::joinpath(path(), d->d_name)); |
87 |
time_t ts = Path::timestamp(str::joinpath(path(), *d)); |
| 88 |
if (ts > max) max = ts; |
88 |
if (ts > max) max = ts; |
| 89 |
} |
89 |
} |
| 90 |
|
90 |
|
|
Lines 93-107
Link Here
|
| 93 |
|
93 |
|
| 94 |
void SourceDir::readVocabularies(VocabularyMerger& out) |
94 |
void SourceDir::readVocabularies(VocabularyMerger& out) |
| 95 |
{ |
95 |
{ |
| 96 |
if (!valid()) return; |
96 |
if (!exists()) return; |
| 97 |
|
97 |
|
| 98 |
for (const_iterator d = begin(); d != end(); ++d) |
98 |
for (const_iterator d = begin(); d != end(); ++d) |
| 99 |
{ |
99 |
{ |
| 100 |
FileType type = fileType(d->d_name); |
100 |
FileType type = fileType(*d); |
| 101 |
if (type == VOC) |
101 |
if (type == VOC) |
| 102 |
{ |
102 |
{ |
| 103 |
// Read uncompressed data |
103 |
// Read uncompressed data |
| 104 |
tagcoll::input::Stdio in(str::joinpath(path(), d->d_name)); |
104 |
tagcoll::input::Stdio in(str::joinpath(path(), *d)); |
| 105 |
|
105 |
|
| 106 |
// Read the vocabulary |
106 |
// Read the vocabulary |
| 107 |
out.read(in); |
107 |
out.read(in); |
|
Lines 109-115
Link Here
|
| 109 |
else if (type == VOCGZ) |
109 |
else if (type == VOCGZ) |
| 110 |
{ |
110 |
{ |
| 111 |
// Read compressed data |
111 |
// Read compressed data |
| 112 |
tagcoll::input::Zlib in(str::joinpath(path(), d->d_name)); |
112 |
tagcoll::input::Zlib in(str::joinpath(path(), *d)); |
| 113 |
|
113 |
|
| 114 |
// Read the vocabulary |
114 |
// Read the vocabulary |
| 115 |
out.read(in); |
115 |
out.read(in); |