ocean.text.arguments.TimeIntervalArgs

Handler for time interval CLI arguments

One Argument

Date:
    Gives the range for that day.
    "-t 2019-04-01" (start: 2019-04-01 00:00:00, end: 2019-04-01 23:59:59 )

TimeStamp
    Gives a range from the provided timestamp plus one day.
    "-t 1554132392" (start: 1554132392, end: 1554218791)

Timerange
    Gives X amount in the past NOT including the current second.
    "-t 1m" with now:1000 (start:940, end:999)

Two Arguments

Dates: Start is parsed inclusively, end is parsed exclusively eg. -t "2019-04-01 2019-04-02" (start: 2019-04-01 00:00:00) ( end: 2019-04-02 23:59:59)

TimeStamp Start is treated as is, end is NOT included in final range. eg. -t 100 200 = (begin: 100, end: 199)

Timerange End range includes the starting second. eg. -t 100 1m = (begin: 100, end: 159) eg. -t 1m 100 = (begin: 60, end: 99)

Intended Range Usage for ( long i = range.begin; i <= range.end; ++i )

Members

Functions

isTimeInterval
bool isTimeInterval(cstring value)

Checks if a string can be converted to a time interval

parseTimeInterval
long parseTimeInterval(cstring value)

Converts a string to seconds

processTimeIntervalArgs
TimestampInterval processTimeIntervalArgs(Arguments args)

Process the time-interval argument

setupTimeIntervalArgs
void setupTimeIntervalArgs(Arguments args, bool required)

Add application-specific command line arguments for the selecting a time interval

validateTimeIntervalArgs
istring validateTimeIntervalArgs(Arguments args)

Validate the time-interval argument

Static variables

SECONDS_IN_DAY
auto SECONDS_IN_DAY;

Number of seconds in the day for creating day ranges.

TEST_TIME_NOW
auto TEST_TIME_NOW;
Undocumented in source.

Structs

TimestampInterval
struct TimestampInterval

Structure reoresenting a Timestamp interval

Meta