Add DOM query dom.tracked.tags

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-05-08 15:14:27 +02:00
parent 5c234c95f9
commit 6e5236d472
2 changed files with 55 additions and 1 deletions

View file

@ -108,6 +108,29 @@ bool domGet (
auto tracked = getTracked (database, rules, filter);
int count = static_cast <int> (tracked.size ());
// dom.tracked.tags
if (pig.skipLiteral ("tags"))
{
std::set <std::string> tags;
for (const auto& interval : tracked)
{
for (const auto &tag : interval.tags ())
{
tags.insert (tag);
}
}
std::stringstream s;
for (const auto& tag : tags)
{
s << format ( "{1} ", tag );
}
value = s.str();
return true;
}
// dom.tracked.count
if (pig.skipLiteral ("count"))
{