From f60f61201c22eacfde489b66347ae96c14f477be Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 28 May 2016 20:27:02 -0400 Subject: [PATCH] Rename Leap to leap --- tz.cpp | 8 ++++---- tz.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tz.cpp b/tz.cpp index a952830..b386f53 100644 --- a/tz.cpp +++ b/tz.cpp @@ -1926,9 +1926,9 @@ operator<<(std::ostream& os, const link& x) return os << x.name_ << " --> " << x.target_; } -// Leap +// leap -Leap::Leap(const std::string& s, detail::undocumented) +leap::leap(const std::string& s, detail::undocumented) { using namespace date; std::istringstream in(s); @@ -1941,7 +1941,7 @@ Leap::Leap(const std::string& s, detail::undocumented) } std::ostream& -operator<<(std::ostream& os, const Leap& x) +operator<<(std::ostream& os, const leap& x) { using namespace date; return os << x.date_ << " +"; @@ -2151,7 +2151,7 @@ init_tzdb() } else if (word == "Leap") { - db.leaps.push_back(Leap(line, detail::undocumented{})); + db.leaps.push_back(leap(line, detail::undocumented{})); continue_zone = false; } else if (word == "Zone") diff --git a/tz.h b/tz.h index 4c47162..5b42535 100644 --- a/tz.h +++ b/tz.h @@ -516,23 +516,23 @@ inline bool operator> (const link& x, const link& y) {return y < x;} inline bool operator<=(const link& x, const link& y) {return !(y < x);} inline bool operator>=(const link& x, const link& y) {return !(x < y);} -class Leap +class leap { private: sys_seconds date_; public: - explicit Leap(const std::string& s, detail::undocumented); + explicit leap(const std::string& s, detail::undocumented); sys_seconds date() const {return date_;} - friend bool operator==(const Leap& x, const Leap& y) {return x.date_ == y.date_;} - friend bool operator< (const Leap& x, const Leap& y) {return x.date_ < y.date_;} + friend bool operator==(const leap& x, const leap& y) {return x.date_ == y.date_;} + friend bool operator< (const leap& x, const leap& y) {return x.date_ < y.date_;} template friend bool - operator==(const Leap& x, const sys_time& y) + operator==(const leap& x, const sys_time& y) { return x.date_ == y; } @@ -540,7 +540,7 @@ public: template friend bool - operator< (const Leap& x, const sys_time& y) + operator< (const leap& x, const sys_time& y) { return x.date_ < y; } @@ -548,23 +548,23 @@ public: template friend bool - operator< (const sys_time& x, const Leap& y) + operator< (const sys_time& x, const leap& y) { return x < y.date_; } - friend std::ostream& operator<<(std::ostream& os, const Leap& x); + friend std::ostream& operator<<(std::ostream& os, const leap& x); }; -inline bool operator!=(const Leap& x, const Leap& y) {return !(x == y);} -inline bool operator> (const Leap& x, const Leap& y) {return y < x;} -inline bool operator<=(const Leap& x, const Leap& y) {return !(y < x);} -inline bool operator>=(const Leap& x, const Leap& y) {return !(x < y);} +inline bool operator!=(const leap& x, const leap& y) {return !(x == y);} +inline bool operator> (const leap& x, const leap& y) {return y < x;} +inline bool operator<=(const leap& x, const leap& y) {return !(y < x);} +inline bool operator>=(const leap& x, const leap& y) {return !(x < y);} template inline bool -operator==(const sys_time& x, const Leap& y) +operator==(const sys_time& x, const leap& y) { return y == x; } @@ -572,7 +572,7 @@ operator==(const sys_time& x, const Leap& y) template inline bool -operator!=(const Leap& x, const sys_time& y) +operator!=(const leap& x, const sys_time& y) { return !(x == y); } @@ -580,7 +580,7 @@ operator!=(const Leap& x, const sys_time& y) template inline bool -operator!=(const sys_time& x, const Leap& y) +operator!=(const sys_time& x, const leap& y) { return !(x == y); } @@ -588,7 +588,7 @@ operator!=(const sys_time& x, const Leap& y) template inline bool -operator> (const Leap& x, const sys_time& y) +operator> (const leap& x, const sys_time& y) { return y < x; } @@ -596,7 +596,7 @@ operator> (const Leap& x, const sys_time& y) template inline bool -operator> (const sys_time& x, const Leap& y) +operator> (const sys_time& x, const leap& y) { return y < x; } @@ -604,7 +604,7 @@ operator> (const sys_time& x, const Leap& y) template inline bool -operator<=(const Leap& x, const sys_time& y) +operator<=(const leap& x, const sys_time& y) { return !(y < x); } @@ -612,7 +612,7 @@ operator<=(const Leap& x, const sys_time& y) template inline bool -operator<=(const sys_time& x, const Leap& y) +operator<=(const sys_time& x, const leap& y) { return !(y < x); } @@ -620,7 +620,7 @@ operator<=(const sys_time& x, const Leap& y) template inline bool -operator>=(const Leap& x, const sys_time& y) +operator>=(const leap& x, const sys_time& y) { return !(x < y); } @@ -628,7 +628,7 @@ operator>=(const Leap& x, const sys_time& y) template inline bool -operator>=(const sys_time& x, const Leap& y) +operator>=(const sys_time& x, const leap& y) { return !(x < y); } @@ -683,7 +683,7 @@ struct TZ_DB std::string version; std::vector zones; std::vector links; - std::vector leaps; + std::vector leaps; std::vector rules; #if TIMEZONE_MAPPING // TODO! These need some protection.