Go to the documentation of this file.
50 TimeRange::TimeRange():
53 includeStartTime(true),
60 const bool startInclusive,
61 const bool endInclusive )
65 init( startDT, endDT, startInclusive, endInclusive );
67 catch (TimeRangeException tre)
69 tre.addText(
"Initializing from two CommonTime values.\n");
75 const bool startInclusive,
76 const bool endInclusive )
85 catch (TimeRangeException tre)
87 tre.addText(
"Initializing from a CommonTime pair.\n");
95 const bool startInclusive,
96 const bool endInclusive )
100 string tform =
"%02m/%02d/%4Y %02H:%02M:%02S %Q";
101 TimeRangeException tre;
102 tre.addText(
"TimeRange() - Start time must be before end time.\n");
103 string ts =
" start: ";
122 const bool startInclusive,
123 const bool endInclusive )
127 init( startDT, endDT, startInclusive, endInclusive );
129 catch (TimeRangeException tre)
131 tre.addText(
"Called from TimeRange::set().\n");
150 if (testDT<
start)
return false;
151 if (
end<testDT)
return false;
153 testDT <
end)
return true;
252 end<=right.
end )
return true;
279 std::string whitespace(
" \t\n");
280 std::string::size_type n = str.find_first_not_of(whitespace);
282 if (n == string::npos)
284 TimeRangeException tre;
285 tre.addText(
"TimeRange:Failure finding first non-whitespace character");
289 string leadChar = str.substr(n,1);
292 if (leadChar.compare(
"[")==0)
297 else if (leadChar.compare(
"(")==0)
304 std::string::size_type endFirstTime = str.find(
",", n);
305 std::string firstTime = str.substr(n, endFirstTime-n);
313 catch(InvalidRequest& exc)
315 TimeRangeException tre(exc);
316 tre.addText(
"TimeRange:Failure converting first time");
319 catch(std::exception& exc)
321 TimeRangeException tre(exc.what());
322 tre.addText(
"TimeRange:Failure converting first time");
330 std::string::size_type endCharPos = str.find_first_of(
"])", endFirstTime+1);
331 std::string::size_type endSecondTime = endCharPos;
333 if (endCharPos!=std::string::npos)
336 string endChar = str.substr(endCharPos,1);
338 if (endChar.compare(
")")==0)
344 std::string secondTime = str.substr( endFirstTime+1, endSecondTime-endFirstTime );
351 catch(InvalidRequest& exc)
353 TimeRangeException tre(exc);
354 tre.addText(
"TimeRange:Failure converting second time");
357 catch(std::exception& exc)
359 TimeRangeException tre(exc.what());
360 tre.addText(
"TimeRange:Failure converting second time");
367 TimeRangeException tre(
"Ending time is prior to beginning time");
386 char includeEnd =
']';
401 else out +=
"(Start:";
406 char includeEnd =
']';
bool operator==(const TimeRange &right) const
Equivalence means all members are identical.
const Epoch BEGINNING_OF_TIME(CommonTime::BEGINNING_OF_TIME)
Earliest representable Epoch.
void init(const CommonTime &startDT, const CommonTime &endDT, const bool startInclusive=true, const bool endInclusive=true)
bool operator<(const TimeRange &right) const
bool overlaps(const TimeRange &right) const
std::string printf(const std::string formatArg="%02m/%02d/%02y %02H:%02M:%02S") const
std::string & stripLeading(std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
bool inRange(const CommonTime &testDT) const
bool isSubsetOf(const TimeRange &right) const
void mixedScanTime(CommonTime &t, const string &str, const string &fmt)
bool isAfter(const TimeRange &right) const
bool isPriorTo(const TimeRange &right) const
void set(const CommonTime &startDT, const CommonTime &endDT, const bool startInclusive=true, const bool endInclusive=true)
const Epoch END_OF_TIME(CommonTime::END_OF_TIME)
Latest Representable Epoch.
#define GNSSTK_RETHROW(exc)
std::string dump(const std::string formatArg="%02m/%02d/%02y %02H:%02M:%02S") const
Dump method.
std::string printTime(const CommonTime &t, const std::string &fmt)
std::pair< CommonTime, CommonTime > DTPair
#define GNSSTK_THROW(exc)
TimeRange & setToString(const std::string &str, const std::string &fmt)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42