summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-21 22:00:35 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-11-25 11:32:19 +0100
commit887b07aa284af75516fbf54e3db88acbf7e51b0c (patch)
treeeeb6e67e58502281d850332ad620a59ff11effce /apt-pkg/cachefilter-patterns.h
parent83f2732b10498c4a3abdfbc072da63803557ce9b (diff)
patterns: Add base class for regular expression matching
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index d37da815f..f13edbbc2 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -117,6 +117,21 @@ namespace Patterns
{
using namespace APT::CacheFilter;
+/** \brief Basic helper class for matching regex */
+class BaseRegexMatcher
+{
+ regex_t *pattern;
+
+ public:
+ BaseRegexMatcher(std::string const &string);
+ ~BaseRegexMatcher();
+ bool operator()(const char *cstring);
+ bool operator()(std::string const &string)
+ {
+ return (*this)(string.c_str());
+ }
+};
+
struct PackageIsAutomatic : public PackageMatcher
{
pkgCacheFile *Cache;