]> git.saurik.com Git - apt.git/blame - apt-pkg/cachefilter.h
cherry pick 39a07ec8f2c612a5af234c7713571362f7ca90b4
[apt.git] / apt-pkg / cachefilter.h
CommitLineData
9ba5aa3b
DK
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/** \file cachefilter.h
4 Collection of functor classes */
5 /*}}}*/
6#ifndef APT_CACHEFILTER_H
7#define APT_CACHEFILTER_H
8// Include Files /*{{{*/
9#include <apt-pkg/pkgcache.h>
10
11#include <string>
12
13#include <regex.h>
14 /*}}}*/
15namespace APT {
16namespace CacheFilter {
17// PackageNameMatchesRegEx /*{{{*/
18class PackageNameMatchesRegEx {
be9b62f7
MV
19 /** \brief dpointer placeholder (for later in case we need it) */
20 void *d;
9ba5aa3b
DK
21 regex_t* pattern;
22public:
23 PackageNameMatchesRegEx(std::string const &Pattern);
24 bool operator() (pkgCache::PkgIterator const &Pkg);
25 bool operator() (pkgCache::GrpIterator const &Grp);
26 ~PackageNameMatchesRegEx();
27};
28 /*}}}*/
424ff669
DK
29// PackageArchitectureMatchesSpecification /*{{{*/
30/** \class PackageArchitectureMatchesSpecification
31 \brief matching against architecture specification strings
32
33 The strings are of the format <kernel>-<cpu> where either component,
34 or the whole string, can be the wildcard "any" as defined in
35 debian-policy ยง11.1 "Architecture specification strings".
36
37 Examples: i386, mipsel, linux-any, any-amd64, any */
38class PackageArchitectureMatchesSpecification {
39 std::string literal;
40 std::string complete;
41 bool isPattern;
42 /** \brief dpointer placeholder (for later in case we need it) */
43 void *d;
44public:
45 /** \brief matching against architecture specification strings
46 *
47 * @param pattern is the architecture specification string
48 * @param isPattern defines if the given \b pattern is a
49 * architecture specification pattern to match others against
50 * or if it is the fixed string and matched against patterns
51 */
52 PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern = true);
53 bool operator() (char const * const &arch);
54 bool operator() (pkgCache::PkgIterator const &Pkg);
55 bool operator() (pkgCache::VerIterator const &Ver);
56 ~PackageArchitectureMatchesSpecification();
57};
58 /*}}}*/
9ba5aa3b
DK
59}
60}
61#endif