diff --git a/src/dom.cpp b/src/dom.cpp index 1431e549..a1056d89 100644 --- a/src/dom.cpp +++ b/src/dom.cpp @@ -94,6 +94,31 @@ bool domGet ( pig.restore (); } + + else if (pig.skipLiteral ("tag.")) + { + // Generate a unique, ordered list of tags. + std::set tags; + for (auto& line : database.allLines ()) + { + if (line[0] == 'i') + { + Interval interval; + interval.initialize (line); + + for (auto& tag : interval.tags ()) + tags.insert (tag); + } + } + + // dom.tag.count + if (pig.skipLiteral ("count")) + { + value = format ("{1}", tags.size ()); + return true; + } + + } } return false;