From 2169e8e9282fd724cda2153f5ca243584676ebc9 Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Fri, 8 May 2020 17:31:39 +0200 Subject: [PATCH] Add/update descriptive comments Signed-off-by: Thomas Lauf --- src/dom.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/dom.cpp b/src/dom.cpp index c1cdb026..3960000e 100644 --- a/src/dom.cpp +++ b/src/dom.cpp @@ -43,6 +43,7 @@ bool domGet ( Pig pig (reference); if (pig.skipLiteral ("dom.")) { + // dom.active if (pig.skipLiteral ("active")) { auto latest = getLatestInterval (database); @@ -103,6 +104,7 @@ bool domGet ( } } + // dom.tracked.<...> else if (pig.skipLiteral ("tracked.")) { auto tracked = getTracked (database, rules, filter); @@ -139,25 +141,26 @@ bool domGet ( } int n; + // dom.tracked..<...> if (pig.getDigits (n) && n <= count && pig.skipLiteral (".")) { - // dom.tracked.N.tag.count + // dom.tracked..tag.count if (pig.skipLiteral ("tag.count")) { value = format ("{1}", tracked[count - n].tags ().size ()); return true; } - // dom.tracked.N.start + // dom.tracked..start if (pig.skipLiteral ("start")) { value = tracked[count - n].start.toISOLocalExtended (); return true; } - // dom.tracked.N.end + // dom.tracked..end if (pig.skipLiteral ("end")) { if (tracked[count -n].is_open ()) @@ -167,14 +170,14 @@ bool domGet ( return true; } - // dom.tracked.N.duration + // dom.tracked..duration if (pig.skipLiteral ("duration")) { value = Duration (tracked[count - n].total ()).formatISO (); return true; } - // dom.tracked.N.json + // dom.tracked..json if (pig.skipLiteral ("json")) { value = tracked[count - n].json (); @@ -182,6 +185,7 @@ bool domGet ( } int n; + // dom.tracked..tag. if (pig.skipLiteral ("tag.") && pig.getDigits (n)) { @@ -198,6 +202,7 @@ bool domGet ( } } + // dom.tag.<...> else if (pig.skipLiteral ("tag.")) { // get unique, ordered list of tags. @@ -210,8 +215,8 @@ bool domGet ( return true; } - // dom.tag. int n; + // dom.tag. if (pig.getDigits (n)) { if (n <= static_cast (tags.size ()))