diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-05-18 16:45:18 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-05-18 16:45:18 +0300 |
commit | 2f648d65387d62a61e36d8b913a9fc7c70fc4d6f (patch) | |
tree | c7022abdf6f134cec95e544e9fedb53a2522e5db /3party/opening_hours/opening_hours.hpp | |
parent | d2f79bd2c7004af2d1459e8d5b7748763f241a54 (diff) |
Opening hours twenty four hours fix
Diffstat (limited to '3party/opening_hours/opening_hours.hpp')
-rw-r--r-- | 3party/opening_hours/opening_hours.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/3party/opening_hours/opening_hours.hpp b/3party/opening_hours/opening_hours.hpp index df4b9c5a9b..faf3119121 100644 --- a/3party/opening_hours/opening_hours.hpp +++ b/3party/opening_hours/opening_hours.hpp @@ -30,9 +30,11 @@ #include <type_traits> #include <vector> +// Implemented in accordance with the specification +// http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification + namespace osmoh { - class HourMinutes { public: @@ -170,6 +172,7 @@ inline constexpr Time::TMinutes operator ""_min(unsigned long long int m) } std::ostream & operator<<(std::ostream & ost, Time const & time); +bool operator==(Time const & lhs, Time const & rhs); class TimespanPeriod { @@ -189,6 +192,8 @@ public: bool IsHoursMinutes() const { return m_type == Type::HourMinutes; } bool IsMinutes() const { return m_type == Type::Minutes; } + Type GetType() const { return m_type; } + HourMinutes const & GetHourMinutes() const { return m_hourMinutes; } HourMinutes::TMinutes GetMinutes() const { return m_minutes; } HourMinutes::TMinutes::rep GetMinutesCount() const { return GetMinutes().count(); } @@ -201,6 +206,7 @@ private: }; std::ostream & operator<<(std::ostream & ost, TimespanPeriod const p); +bool operator==(TimespanPeriod const & lhs, TimespanPeriod const & rhs); class Timespan { @@ -244,6 +250,7 @@ using TTimespans = std::vector<Timespan>; std::ostream & operator<<(std::ostream & ost, Timespan const & span); std::ostream & operator<<(std::ostream & ost, osmoh::TTimespans const & timespans); +bool operator==(Timespan const & lhs, Timespan const & rhs); class NthWeekdayOfTheMonthEntry { |