From 387e54498e60736eea136551aaa2dd78f096eedc Mon Sep 17 00:00:00 2001 From: Brenno Lemos Date: Mon, 9 Oct 2023 14:46:57 -0300 Subject: [PATCH] docs: document new regex collection class --- include/util/regex_collection.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/util/regex_collection.hpp b/include/util/regex_collection.hpp index 267bb726..14f28611 100644 --- a/include/util/regex_collection.hpp +++ b/include/util/regex_collection.hpp @@ -16,6 +16,14 @@ struct Rule { int default_priority_function(std::string& key); +/* A collection of regexes and strings, with a default string to return if no regexes. + * When a regex is matched, the corresponding string is returned. + * All regexes that are matched are cached, so that the regexes are only + * evaluated once against a given string. + * Regexes may be given a higher priority than others, so that they are matched + * first. The priority function is given the regex string, and should return a + * higher number for higher priority regexes. + */ class RegexCollection { private: std::vector rules;