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

Function MakeOpeningHours

libs/editor/ui2oh.cpp:284–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282namespace editor
283{
284osmoh::OpeningHours MakeOpeningHours(ui::TimeTableSet const & tts)
285{
286 ASSERT_GREATER(tts.Size(), 0, ("At least one time table must present."));
287
288 if (tts.IsTwentyFourPerSeven())
289 {
290 osmoh::RuleSequence rulePart;
291 rulePart.SetTwentyFourHours(true);
292 return osmoh::OpeningHours({rulePart});
293 }
294
295 osmoh::TRuleSequences rule;
296 for (auto const & tt : tts)
297 {
298 osmoh::RuleSequence rulePart;
299 rulePart.SetWeekdays(MakeWeekdays(tt));
300 rulePart.SetTimes(MakeTimespans(tt));
301 rule.push_back(rulePart);
302 }
303
304 return rule;
305}
306
307bool MakeTimeTableSet(osmoh::OpeningHours const & oh, ui::TimeTableSet & tts)
308{

Calls 8

MakeWeekdaysFunction · 0.85
MakeTimespansFunction · 0.85
SetWeekdaysMethod · 0.80
SetTimesMethod · 0.80
OpeningHoursClass · 0.70
SizeMethod · 0.45
SetTwentyFourHoursMethod · 0.45
push_backMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.68