MCPcopy Create free account
hub / github.com/comaps/comaps / GetInfo

Method GetInfo

3party/opening_hours/opening_hours.cpp:901–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

899}
900
901OpeningHours::InfoT OpeningHours::GetInfo(time_t const dateTime) const
902{
903 InfoT info;
904 info.state = GetState(m_rule, dateTime);
905 if (info.state != RuleState::Unknown)
906 {
907 if (info.state == RuleState::Open)
908 info.nextTimeOpen = dateTime;
909 else
910 info.nextTimeOpen = osmoh::GetNextTimeState(m_rule, dateTime, RuleState::Open);
911
912 if (info.state == RuleState::Closed)
913 info.nextTimeClosed = dateTime;
914 else
915 info.nextTimeClosed = osmoh::GetNextTimeState(m_rule, dateTime, RuleState::Closed);
916 }
917
918 return info;
919}
920
921bool OpeningHours::IsValid() const
922{

Callers

nothing calls this directly

Calls 2

GetStateFunction · 0.85
GetNextTimeStateFunction · 0.85

Tested by

no test coverage detected