Rename Leap to leap

This commit is contained in:
Howard Hinnant
2016-05-28 20:27:02 -04:00
parent b0a23f2cff
commit f60f61201c
2 changed files with 26 additions and 26 deletions

8
tz.cpp
View File

@@ -1926,9 +1926,9 @@ operator<<(std::ostream& os, const link& x)
return os << x.name_ << " --> " << x.target_; 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; using namespace date;
std::istringstream in(s); std::istringstream in(s);
@@ -1941,7 +1941,7 @@ Leap::Leap(const std::string& s, detail::undocumented)
} }
std::ostream& std::ostream&
operator<<(std::ostream& os, const Leap& x) operator<<(std::ostream& os, const leap& x)
{ {
using namespace date; using namespace date;
return os << x.date_ << " +"; return os << x.date_ << " +";
@@ -2151,7 +2151,7 @@ init_tzdb()
} }
else if (word == "Leap") else if (word == "Leap")
{ {
db.leaps.push_back(Leap(line, detail::undocumented{})); db.leaps.push_back(leap(line, detail::undocumented{}));
continue_zone = false; continue_zone = false;
} }
else if (word == "Zone") else if (word == "Zone")

44
tz.h
View File

@@ -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 !(y < x);}
inline bool operator>=(const link& x, const link& y) {return !(x < y);} inline bool operator>=(const link& x, const link& y) {return !(x < y);}
class Leap class leap
{ {
private: private:
sys_seconds date_; sys_seconds date_;
public: public:
explicit Leap(const std::string& s, detail::undocumented); explicit leap(const std::string& s, detail::undocumented);
sys_seconds date() const {return date_;} 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 <class Duration> template <class Duration>
friend friend
bool bool
operator==(const Leap& x, const sys_time<Duration>& y) operator==(const leap& x, const sys_time<Duration>& y)
{ {
return x.date_ == y; return x.date_ == y;
} }
@@ -540,7 +540,7 @@ public:
template <class Duration> template <class Duration>
friend friend
bool bool
operator< (const Leap& x, const sys_time<Duration>& y) operator< (const leap& x, const sys_time<Duration>& y)
{ {
return x.date_ < y; return x.date_ < y;
} }
@@ -548,23 +548,23 @@ public:
template <class Duration> template <class Duration>
friend friend
bool bool
operator< (const sys_time<Duration>& x, const Leap& y) operator< (const sys_time<Duration>& x, const leap& y)
{ {
return x < y.date_; 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 !(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 !(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);}
template <class Duration> template <class Duration>
inline inline
bool bool
operator==(const sys_time<Duration>& x, const Leap& y) operator==(const sys_time<Duration>& x, const leap& y)
{ {
return y == x; return y == x;
} }
@@ -572,7 +572,7 @@ operator==(const sys_time<Duration>& x, const Leap& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator!=(const Leap& x, const sys_time<Duration>& y) operator!=(const leap& x, const sys_time<Duration>& y)
{ {
return !(x == y); return !(x == y);
} }
@@ -580,7 +580,7 @@ operator!=(const Leap& x, const sys_time<Duration>& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator!=(const sys_time<Duration>& x, const Leap& y) operator!=(const sys_time<Duration>& x, const leap& y)
{ {
return !(x == y); return !(x == y);
} }
@@ -588,7 +588,7 @@ operator!=(const sys_time<Duration>& x, const Leap& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator> (const Leap& x, const sys_time<Duration>& y) operator> (const leap& x, const sys_time<Duration>& y)
{ {
return y < x; return y < x;
} }
@@ -596,7 +596,7 @@ operator> (const Leap& x, const sys_time<Duration>& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator> (const sys_time<Duration>& x, const Leap& y) operator> (const sys_time<Duration>& x, const leap& y)
{ {
return y < x; return y < x;
} }
@@ -604,7 +604,7 @@ operator> (const sys_time<Duration>& x, const Leap& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator<=(const Leap& x, const sys_time<Duration>& y) operator<=(const leap& x, const sys_time<Duration>& y)
{ {
return !(y < x); return !(y < x);
} }
@@ -612,7 +612,7 @@ operator<=(const Leap& x, const sys_time<Duration>& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator<=(const sys_time<Duration>& x, const Leap& y) operator<=(const sys_time<Duration>& x, const leap& y)
{ {
return !(y < x); return !(y < x);
} }
@@ -620,7 +620,7 @@ operator<=(const sys_time<Duration>& x, const Leap& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator>=(const Leap& x, const sys_time<Duration>& y) operator>=(const leap& x, const sys_time<Duration>& y)
{ {
return !(x < y); return !(x < y);
} }
@@ -628,7 +628,7 @@ operator>=(const Leap& x, const sys_time<Duration>& y)
template <class Duration> template <class Duration>
inline inline
bool bool
operator>=(const sys_time<Duration>& x, const Leap& y) operator>=(const sys_time<Duration>& x, const leap& y)
{ {
return !(x < y); return !(x < y);
} }
@@ -683,7 +683,7 @@ struct TZ_DB
std::string version; std::string version;
std::vector<time_zone> zones; std::vector<time_zone> zones;
std::vector<link> links; std::vector<link> links;
std::vector<Leap> leaps; std::vector<leap> leaps;
std::vector<Rule> rules; std::vector<Rule> rules;
#if TIMEZONE_MAPPING #if TIMEZONE_MAPPING
// TODO! These need some protection. // TODO! These need some protection.