libept
Main Page
Namespaces
Classes
Files
File List
File Members
ept
debtags
maint
debtags/maint/sourcedir.h
Go to the documentation of this file.
1
#ifndef EPT_DEBTAGS_SOURCEDIR_H
2
#define EPT_DEBTAGS_SOURCEDIR_H
3
9
/*
10
* Copyright (C) 2003--2013 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 <string>
28
#include <wibble/sys/fs.h>
29
30
namespace
ept
{
31
namespace
debtags {
32
33
class
Vocabulary;
34
38
class
SourceDir
:
public
wibble::sys::fs::Directory
39
{
40
protected
:
41
enum
FileType
{
SKIP
,
TAG
,
VOC
,
TAGGZ
,
VOCGZ
};
42
43
// Check if a file name is a tag file, a vocabulary file or a file to skip.
44
// Please notice that it works on file names, not paths.
45
FileType
fileType
(
const
std::string& name);
46
47
public
:
48
SourceDir
(
const
std::string& path);
49
~SourceDir
();
50
52
time_t
timestamp
();
53
55
time_t
vocTimestamp
();
56
58
time_t
tagTimestamp
();
59
61
template
<
typename
OUT>
62
void
readTags
(OUT out);
63
68
void
readVocabularies
(
Vocabulary
& out);
69
};
70
71
}
72
}
73
74
// vim:set ts=4 sw=4:
75
#endif
ept::debtags::SourceDir::~SourceDir
~SourceDir()
Definition:
debtags/maint/sourcedir.cc:21
ept::debtags::SourceDir::SourceDir
SourceDir(const std::string &path)
Definition:
debtags/maint/sourcedir.cc:17
ept::debtags::SourceDir::VOCGZ
Definition:
debtags/maint/sourcedir.h:41
ept
Definition:
apt.cc:42
ept::debtags::SourceDir::SKIP
Definition:
debtags/maint/sourcedir.h:41
ept::debtags::SourceDir::tagTimestamp
time_t tagTimestamp()
Return the time of the newest tag file in the source directory.
Definition:
debtags/maint/sourcedir.cc:92
ept::debtags::SourceDir::VOC
Definition:
debtags/maint/sourcedir.h:41
ept::debtags::SourceDir::FileType
FileType
Definition:
debtags/maint/sourcedir.h:41
ept::debtags::SourceDir
Access a directory containing Debtags data files.
Definition:
debtags/maint/sourcedir.h:38
ept::debtags::Vocabulary
Definition:
vocabulary.h:149
ept::debtags::SourceDir::fileType
FileType fileType(const std::string &name)
Definition:
debtags/maint/sourcedir.cc:25
ept::debtags::SourceDir::readTags
void readTags(OUT out)
Read the tag files in the directory and output their content to out.
ept::debtags::SourceDir::TAG
Definition:
debtags/maint/sourcedir.h:41
ept::debtags::SourceDir::TAGGZ
Definition:
debtags/maint/sourcedir.h:41
ept::debtags::SourceDir::readVocabularies
void readVocabularies(Vocabulary &out)
Read the vocabulary files in the directory and output their content to out.
Definition:
debtags/maint/sourcedir.cc:110
ept::debtags::SourceDir::vocTimestamp
time_t vocTimestamp()
Return the time of the newest vocabulary file in the source directory.
Definition:
debtags/maint/sourcedir.cc:74
ept::debtags::SourceDir::timestamp
time_t timestamp()
Return the time of the newest file in the source directory.
Definition:
debtags/maint/sourcedir.cc:56
Generated on Mon Oct 6 2014 18:15:02 for libept by
1.8.8