Rename seconds_point to second_point for consistency with day_point.

This commit is contained in:
Howard Hinnant
2015-08-08 13:20:12 -04:00
parent 0d0841f5b8
commit 33f923b508
3 changed files with 30 additions and 30 deletions

12
tz.cpp
View File

@@ -485,7 +485,7 @@ parse_signed_time(std::istream& in)
// MonthDayTime
MonthDayTime::MonthDayTime(seconds_point tp, tz timezone)
MonthDayTime::MonthDayTime(second_point tp, tz timezone)
: zone_(timezone)
{
using namespace date;
@@ -578,7 +578,7 @@ MonthDayTime::compare(date::year y, const MonthDayTime& x, date::year yx,
return t0 < t1 ? -1 : t0 == t1 ? 0 : 1;
}
seconds_point
second_point
MonthDayTime::to_sys(date::year y, std::chrono::seconds offset,
std::chrono::seconds save) const
{
@@ -640,7 +640,7 @@ MonthDayTime::to_day_point(date::year y) const
return day_point(x) + (wd1-wd0);
}
seconds_point
second_point
MonthDayTime::to_time_point(date::year y) const
{
return to_day_point(y) + h_ + m_ + s_;
@@ -1411,8 +1411,8 @@ find_rule_for_zone(const std::pair<const Rule*, const Rule*>& eqr,
static
std::pair<const Rule*, date::year>
find_rule_for_zone(const std::pair<const Rule*, const Rule*>& eqr,
const seconds_point& tp_utc, const seconds_point& tp_std,
const seconds_point& tp_loc)
const second_point& tp_utc, const second_point& tp_std,
const second_point& tp_loc)
{
using namespace std::chrono;
using namespace date;
@@ -1630,7 +1630,7 @@ Zone::get_info(std::chrono::system_clock::time_point tp, tz timezone) const
+ std::to_string(static_cast<int>(max_year)) + "]");
auto tps = floor<seconds>(tp);
auto i = std::upper_bound(zonelets_.begin(), zonelets_.end(), tps,
[timezone](seconds_point t, const zonelet& zl)
[timezone](second_point t, const zonelet& zl)
{
return timezone == tz::utc ? t < zl.until_utc_ : t < zl.until_loc_;
});

36
tz.h
View File

@@ -54,8 +54,8 @@ Technically any OS may required mapping.
namespace date
{
using seconds_point = std::chrono::time_point<std::chrono::system_clock,
std::chrono::seconds>;
using second_point = std::chrono::time_point<std::chrono::system_clock,
std::chrono::seconds>;
enum class tz {utc, local, standard};
enum class choose {earliest, latest};
@@ -67,9 +67,9 @@ public:
template <class Rep, class Period>
nonexistent_local_time(std::chrono::time_point<std::chrono::system_clock,
std::chrono::duration<Rep, Period>> tp,
seconds_point first, const std::string& first_abbrev,
seconds_point last, const std::string& last_abbrev,
seconds_point time_sys);
second_point first, const std::string& first_abbrev,
second_point last, const std::string& last_abbrev,
second_point time_sys);
private:
template <class Rep, class Period>
@@ -77,9 +77,9 @@ private:
std::string
make_msg(std::chrono::time_point<std::chrono::system_clock,
std::chrono::duration<Rep, Period>> tp,
seconds_point first, const std::string& first_abbrev,
seconds_point last, const std::string& last_abbrev,
seconds_point time_sys);
second_point first, const std::string& first_abbrev,
second_point last, const std::string& last_abbrev,
second_point time_sys);
};
template <class Rep, class Period>
@@ -87,9 +87,9 @@ inline
nonexistent_local_time::nonexistent_local_time(
std::chrono::time_point<std::chrono::system_clock,
std::chrono::duration<Rep, Period>> tp,
seconds_point first, const std::string& first_abbrev,
seconds_point last, const std::string& last_abbrev,
seconds_point time_sys)
second_point first, const std::string& first_abbrev,
second_point last, const std::string& last_abbrev,
second_point time_sys)
: std::runtime_error(make_msg(tp, first, first_abbrev, last, last_abbrev, time_sys))
{}
@@ -97,9 +97,9 @@ template <class Rep, class Period>
std::string
nonexistent_local_time::make_msg(std::chrono::time_point<std::chrono::system_clock,
std::chrono::duration<Rep, Period>> tp,
seconds_point first, const std::string& first_abbrev,
seconds_point last, const std::string& last_abbrev,
seconds_point time_sys)
second_point first, const std::string& first_abbrev,
second_point last, const std::string& last_abbrev,
second_point time_sys)
{
using namespace date;
std::ostringstream os;
@@ -167,8 +167,8 @@ class Rule;
struct Info
{
seconds_point begin;
seconds_point end;
second_point begin;
second_point end;
std::chrono::seconds offset;
std::chrono::minutes save;
std::string abbrev;
@@ -360,12 +360,12 @@ inline bool operator>=(const Link& x, const Link& y) {return !(x < y);}
class Leap
{
private:
seconds_point date_;
second_point date_;
public:
explicit Leap(const std::string& s);
seconds_point date() const {return date_;}
second_point 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_;}

View File

@@ -40,7 +40,7 @@ private:
public:
MonthDayTime() = default;
MonthDayTime(seconds_point tp, tz timezone);
MonthDayTime(second_point tp, tz timezone);
MonthDayTime(const date::month_day& md, tz timezone);
date::day day() const;
@@ -49,11 +49,11 @@ public:
void canonicalize(date::year y);
seconds_point
second_point
to_sys(date::year y, std::chrono::seconds offset, std::chrono::seconds save) const;
date::day_point to_day_point(date::year y) const;
seconds_point to_time_point(date::year y) const;
second_point to_time_point(date::year y) const;
int compare(date::year y, const MonthDayTime& x, date::year yx,
std::chrono::seconds offset, std::chrono::minutes prev_save) const;
@@ -160,9 +160,9 @@ struct Zone::zonelet
std::string format_;
date::year until_year_{0};
MonthDayTime until_date_;
seconds_point until_utc_;
seconds_point until_std_;
seconds_point until_loc_;
second_point until_utc_;
second_point until_std_;
second_point until_loc_;
std::chrono::minutes initial_save_{};
std::string initial_abbrev_;
std::pair<const Rule*, date::year> first_rule_{nullptr, date::year::min()};