Add/update descriptive comments

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-05-08 17:31:39 +02:00
parent a508dd21ea
commit 2169e8e928

View file

@ -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.<N>.<...>
if (pig.getDigits (n) &&
n <= count &&
pig.skipLiteral ("."))
{
// dom.tracked.N.tag.count
// dom.tracked.<N>.tag.count
if (pig.skipLiteral ("tag.count"))
{
value = format ("{1}", tracked[count - n].tags ().size ());
return true;
}
// dom.tracked.N.start
// dom.tracked.<N>.start
if (pig.skipLiteral ("start"))
{
value = tracked[count - n].start.toISOLocalExtended ();
return true;
}
// dom.tracked.N.end
// dom.tracked.<N>.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.<N>.duration
if (pig.skipLiteral ("duration"))
{
value = Duration (tracked[count - n].total ()).formatISO ();
return true;
}
// dom.tracked.N.json
// dom.tracked.<N>.json
if (pig.skipLiteral ("json"))
{
value = tracked[count - n].json ();
@ -182,6 +185,7 @@ bool domGet (
}
int n;
// dom.tracked.<N>.tag.<M>
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.<N>
int n;
// dom.tag.<N>
if (pig.getDigits (n))
{
if (n <= static_cast <int> (tags.size ()))