diff --git a/doc/data.txt b/doc/data.txt index 29475e58..3a0d7cdb 100644 --- a/doc/data.txt +++ b/doc/data.txt @@ -9,9 +9,9 @@ provided by the user representing ongoing work. An exclusion is also a block of time but represents untrackable time, and acts as a mask for the inclusions. Here is a visual example: - Inclusion: |-----------------------------------| tag1 - Exclusion: |---| lunch - Exclusion |---| dinner + Inclusion: [-----------------------------------) tag1 + Exclusion: [---) lunch + Exclusion [---) dinner Timeline: ..:...:...:...:...:...:...:...:...:...:...:...:...:... 7 8 9 10 11 12 1 2 3 4 5 6 7 diff --git a/doc/examples.txt b/doc/examples.txt index 3a154dcd..10a61cb3 100644 --- a/doc/examples.txt +++ b/doc/examples.txt @@ -209,9 +209,9 @@ scripts. To run un quiet mode, add the ':quiet' hint to the command line: - Given this scenario: - Exclusion: ------| - Exclusion: |---------- - Inclusion: |-| + Exclusion: ------) + Exclusion: [---------- + Inclusion: [-) Now: | Timeline: >--o---o---o---o---o---o---o---o---o---o---o---o---o--> 7 8 9 10 11 12 1 2 3 4 5 6 7 diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 634e1293..40e4b6be 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -37,14 +37,14 @@ // // Inputs: // -// |------------------------------------------------------| Timeline -// |-------------------------------------| Inclusion -// |--------| |--------| |--------| Exclusion +// [------------------------------------------------------) Timeline +// [-------------------------------------) Inclusion +// [--------) [--------) [--------) Exclusion // // Derived: // -// |-----------| |----------------| Tracked -// |-------| |-----| Gaps +// [-----------) [----------------) Tracked +// [-------) [-----) Gaps // //////////////////////////////////////////////////////////////////////////////// diff --git a/src/helper.cpp b/src/helper.cpp index a5d53036..e234702b 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -287,12 +287,12 @@ Interval createIntervalFromFilter (const Filter& filter) // // timeline.start timeline.end // | | -// A [--------] | | -// B [----|----] | -// C | [------------] | -// D | [----|----] -// E | | [--------] -// F [----|-------------------|----] +// A [--------) | | +// B [----|----) | +// C | [------------) | +// D | [----|----) +// E | | [--------) +// F [----|-------------------|----) // | | // // We really only need to eliminate A and F. diff --git a/test/daterange.t.cpp b/test/daterange.t.cpp index e839f589..540b0d88 100644 --- a/test/daterange.t.cpp +++ b/test/daterange.t.cpp @@ -49,16 +49,16 @@ int main (int, char**) t.is (i1.isStarted (), true, "Daterange(start=now,end=now).isStarted -> true"); t.is (i1.isEnded (), true, "Daterange(start=now,end=now).isEnded -> true"); - // this |--------| - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [--------) + // A [--------) + // B [--------) + // C [----| + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... Daterange refClosed; refClosed.start (Datetime (6, 1, 2016)); refClosed.end (Datetime (6, 30, 2016)); @@ -83,16 +83,16 @@ int main (int, char**) t.ok (refClosed.overlap (testH), "Daterange: refClosed.overlap(testH)"); t.notok (refClosed.overlap (testI), "Daterange: ! refClosed.overlap(testI)"); - // this |... - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [... + // A [--------) + // B [--------) + // C [----) + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... Daterange refOpen; refOpen.start (Datetime (6, 1, 2016)); @@ -106,16 +106,16 @@ int main (int, char**) t.ok (refOpen.overlap (testH), "Daterange: refOpen.overlap(testH)"); t.ok (refOpen.overlap (testI), "Daterange: refOpen.overlap(testI)"); - // this |--------| - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [--------) + // A [--------) + // B [--------) + // C [----) + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... Daterange empty; t.ok (refClosed.intersect (testA) == empty, "Daterange: refClosed.intersect(testA) == empty"); t.ok (refClosed.intersect (testB) == Daterange (refClosed.start (), testB.end ()), "Daterange: refClosed.intersect(testB) == Daterange(refClosed.start(), testB.end())"); @@ -127,16 +127,16 @@ int main (int, char**) t.ok (refClosed.intersect (testH) == Daterange (testH.start (), refClosed.end ()), "Daterange: refClosed.intersect(testH) == Daterange(testH.start(), refClosed.end())"); t.ok (refClosed.intersect (testI) == empty, "Daterange: refClosed.intersect(testI) == empty"); - // this |... - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [... + // A [--------) + // B [--------) + // C [----) + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... t.ok (refOpen.intersect (testA) == empty, "Daterange: refOpen.intersect(testA) == empty"); t.ok (refOpen.intersect (testB) == Daterange (refOpen.start (), testB.end ()), "Daterange: refOpen.intersect(testB) == Daterange(refOpen.start(), testB.end())"); t.ok (refOpen.intersect (testC) == testC, "Daterange: refOpen.intersect(testC) == testC"); @@ -147,16 +147,16 @@ int main (int, char**) t.ok (refOpen.intersect (testH) == testH, "Daterange: refOpen.intersect(testH) == testH"); t.ok (refOpen.intersect (testI) == testI, "Daterange: refOpen.intersect(testI) == testI"); - // this |--------| - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [--------) + // A [--------) + // B [--------) + // C [----) + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... std::vector closedSubtractA {refClosed}; std::vector closedSubtractB {Daterange (testB.end (), refClosed.end ())}; std::vector closedSubtractC {Daterange (refClosed.start (), testC.start ()), Daterange (testC.end (), refClosed.end ())}; @@ -178,16 +178,16 @@ int main (int, char**) t.ok (refClosed.subtract (testH) == closedSubtractH, "Daterange: refClosed.subtract(testH) == {refClosed.start(), testH.start()}"); t.ok (refClosed.subtract (testI) == closedSubtractI, "Daterange: refClosed.subtract(testI) == {refClosed}"); - // this |... - // A |--------| - // B |--------| - // C |----| - // D |--------| - // E |--------| - // F |-------------| - // G |... - // H |... - // I |... + // this [... + // A [--------) + // B [--------) + // C [----) + // D [--------) + // E [--------) + // F [-------------) + // G [... + // H [... + // I [... std::vector openSubtractA {refOpen}; std::vector openSubtractB {Daterange (testB.end (), refOpen.end ())}; std::vector openSubtractC {Daterange (refOpen.start (), testC.start ()), Daterange (testC.end (), refOpen.end ())};