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

Function MakeTimespans

libs/editor/ui2oh.cpp:151–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151osmoh::TTimespans MakeTimespans(editor::ui::TimeTable const & tt)
152{
153 if (tt.IsTwentyFourHours())
154 return {kTwentyFourHours};
155
156 auto const & excludeTime = tt.GetExcludeTime();
157 if (excludeTime.empty())
158 return {tt.GetOpeningTime()};
159
160 osmoh::TTimespans spans{{tt.GetOpeningTime().GetStart(), excludeTime[0].GetStart()}};
161
162 for (size_t i = 0; i + 1 < excludeTime.size(); ++i)
163 spans.emplace_back(excludeTime[i].GetEnd(), excludeTime[i + 1].GetStart());
164
165 spans.emplace_back(excludeTime.back().GetEnd(), tt.GetOpeningTime().GetEnd());
166
167 return spans;
168}
169
170editor::ui::OpeningDays const kWholeWeek = {
171 osmoh::Weekday::Monday, osmoh::Weekday::Tuesday, osmoh::Weekday::Wednesday, osmoh::Weekday::Thursday,

Callers 1

MakeOpeningHoursFunction · 0.85

Calls 7

backMethod · 0.80
IsTwentyFourHoursMethod · 0.45
emptyMethod · 0.45
GetStartMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45
GetEndMethod · 0.45

Tested by

no test coverage detected