summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-08-15 11:47:00 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-08-15 20:21:34 +0200
commit08b61197f418883ea20563e2251fb60779c0ba87 (patch)
tree6a3bd0c40526d0094e5eec38b15e7e4eaf516068 /apt-pkg/cachefilter-patterns.h
parent7e22425c2cf937fd45160c6bbbda9210ea5d52ba (diff)
Add pattern tree parser infra and connect with cacheset and apt list
This adds a transformation from parse tree into a CacheFilter and connects it with cachesets and the apt list command.
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 dfbcd66a5..3097ba94b 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -98,6 +98,21 @@ struct PatternTreeParser
std::unique_ptr<Node> parseQuotedWord();
};
+/**
+ * \brief PatternParser parses the given sentence into a parse tree.
+ *
+ * The parse tree consists of nodes:
+ * - Word nodes which contains words or quoted words
+ * - Patterns, which represent ?foo and ?foo(...) patterns
+ */
+struct PatternParser
+{
+ pkgCacheFile *file;
+
+ std::unique_ptr<APT::CacheFilter::Matcher> aPattern(std::unique_ptr<PatternTreeParser::Node> &nodeP);
+ std::string aWord(std::unique_ptr<PatternTreeParser::Node> &nodeP);
+};
+
} // namespace Internal
} // namespace APT
#endif