diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2015-12-05 10:07:09 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:03:46 +0300 |
commit | 571fb4bf73e4adff8de52cfe22fc000c2bd43c60 (patch) | |
tree | 498429f1170eb53cdf75252773e4da90e57209cb /3party/opening_hours | |
parent | e585f1036a3bceb4140a8b6dd49295e3fb524a0a (diff) |
Switch to classes due to complexity of a task.
Diffstat (limited to '3party/opening_hours')
-rw-r--r-- | 3party/opening_hours/opening_hours.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/3party/opening_hours/opening_hours.hpp b/3party/opening_hours/opening_hours.hpp index 4ff4ddb4a1..31594695f4 100644 --- a/3party/opening_hours/opening_hours.hpp +++ b/3party/opening_hours/opening_hours.hpp @@ -40,8 +40,8 @@ public: using TMinutes = std::chrono::minutes; HourMinutes() = default; - explicit HourMinutes(THours const duration) { SetDuration(duration); } - explicit HourMinutes(TMinutes const duration) { SetDuration(duration); } + HourMinutes(THours const duration) { SetDuration(duration); } + HourMinutes(TMinutes const duration) { SetDuration(duration); } bool IsEmpty() const { return m_empty; } bool IsExtended() const; @@ -195,6 +195,11 @@ std::ostream & operator<<(std::ostream & ost, TimespanPeriod const p); class Timespan { public: + Timespan() = default; + Timespan(Time const & start, Time const & end): m_start(start), m_end(end) {} + Timespan(HourMinutes::TMinutes const & start, + HourMinutes::TMinutes const & end): m_start(start), m_end(end) {} + bool IsEmpty() const { return !HasStart() && !HasEnd(); } bool IsOpen() const { return HasStart() && !HasEnd(); } bool HasStart() const { return !GetStart().IsEmpty(); } |