forked from HowardHinnant/date
Correct some silly spelling errors.
This commit is contained in:
12
tz.cpp
12
tz.cpp
@@ -824,7 +824,7 @@ Zone::zonelet::zonelet(const zonelet& i)
|
|||||||
, until_std_(i.until_std_)
|
, until_std_(i.until_std_)
|
||||||
, until_loc_(i.until_loc_)
|
, until_loc_(i.until_loc_)
|
||||||
, initial_save_(i.initial_save_)
|
, initial_save_(i.initial_save_)
|
||||||
, initial_abrev_(i.initial_abrev_)
|
, initial_abbrev_(i.initial_abbrev_)
|
||||||
, first_rule_(i.first_rule_)
|
, first_rule_(i.first_rule_)
|
||||||
, last_rule_(i.last_rule_)
|
, last_rule_(i.last_rule_)
|
||||||
{
|
{
|
||||||
@@ -1078,14 +1078,14 @@ find_rule(const std::pair<const Rule*, date::year>& first,
|
|||||||
const std::pair<const Rule*, date::year>& last,
|
const std::pair<const Rule*, date::year>& last,
|
||||||
const date::year& y, const std::chrono::seconds& offset,
|
const date::year& y, const std::chrono::seconds& offset,
|
||||||
const MonthDayTime& mdt, const std::chrono::minutes& initial_save,
|
const MonthDayTime& mdt, const std::chrono::minutes& initial_save,
|
||||||
const std::string& initial_abrev)
|
const std::string& initial_abbrev)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
using namespace date;
|
using namespace date;
|
||||||
auto r = first.first;
|
auto r = first.first;
|
||||||
auto ry = first.second;
|
auto ry = first.second;
|
||||||
Info x{day_point(year::min()/boring_day), day_point(year::max()/boring_day),
|
Info x{day_point(year::min()/boring_day), day_point(year::max()/boring_day),
|
||||||
seconds{0}, initial_save, initial_abrev};
|
seconds{0}, initial_save, initial_abbrev};
|
||||||
while (r != nullptr)
|
while (r != nullptr)
|
||||||
{
|
{
|
||||||
auto tr = r->mdt().to_sys(ry, offset, x.save);
|
auto tr = r->mdt().to_sys(ry, offset, x.save);
|
||||||
@@ -1203,7 +1203,7 @@ Zone::adjust_infos(const std::vector<Rule>& rules)
|
|||||||
if (z.first_rule_.first != nullptr)
|
if (z.first_rule_.first != nullptr)
|
||||||
{
|
{
|
||||||
z.initial_save_ = z.first_rule_.first->save();
|
z.initial_save_ = z.first_rule_.first->save();
|
||||||
z.initial_abrev_ = z.first_rule_.first->abbrev();
|
z.initial_abbrev_ = z.first_rule_.first->abbrev();
|
||||||
if (z.first_rule_ != z.last_rule_)
|
if (z.first_rule_ != z.last_rule_)
|
||||||
{
|
{
|
||||||
z.first_rule_ = find_next_rule(eqr.first, eqr.second,
|
z.first_rule_ = find_next_rule(eqr.first, eqr.second,
|
||||||
@@ -1278,7 +1278,7 @@ Zone::get_info(std::chrono::system_clock::time_point tp, tz timezone) const
|
|||||||
{
|
{
|
||||||
r = find_rule(i->first_rule_, i->last_rule_, y, i->gmtoff_,
|
r = find_rule(i->first_rule_, i->last_rule_, y, i->gmtoff_,
|
||||||
MonthDayTime(floor<seconds>(tp), timezone), i->initial_save_,
|
MonthDayTime(floor<seconds>(tp), timezone), i->initial_save_,
|
||||||
i->initial_abrev_);
|
i->initial_abbrev_);
|
||||||
auto k = i->format_.find("%s");
|
auto k = i->format_.find("%s");
|
||||||
if (k != std::string::npos)
|
if (k != std::string::npos)
|
||||||
{
|
{
|
||||||
@@ -1345,7 +1345,7 @@ operator<<(std::ostream& os, const Zone& z)
|
|||||||
os << " " << s.until_std_ << " STD";
|
os << " " << s.until_std_ << " STD";
|
||||||
os << " " << s.until_loc_;
|
os << " " << s.until_loc_;
|
||||||
os << " " << make_time(s.initial_save_);
|
os << " " << make_time(s.initial_save_);
|
||||||
os << " " << s.initial_abrev_;
|
os << " " << s.initial_abbrev_;
|
||||||
if (s.first_rule_.first != nullptr)
|
if (s.first_rule_.first != nullptr)
|
||||||
os << " {" << *s.first_rule_.first << ", " << s.first_rule_.second << '}';
|
os << " {" << *s.first_rule_.first << ", " << s.first_rule_.second << '}';
|
||||||
else
|
else
|
||||||
|
46
tz.h
46
tz.h
@@ -43,8 +43,8 @@ public:
|
|||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
nonexistent_local_time(std::chrono::time_point<std::chrono::system_clock,
|
nonexistent_local_time(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
seconds_point first, const std::string& first_abrev,
|
seconds_point first, const std::string& first_abbrev,
|
||||||
seconds_point last, const std::string& last_abrev,
|
seconds_point last, const std::string& last_abbrev,
|
||||||
seconds_point time_sys);
|
seconds_point time_sys);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -53,8 +53,8 @@ private:
|
|||||||
std::string
|
std::string
|
||||||
make_msg(std::chrono::time_point<std::chrono::system_clock,
|
make_msg(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
seconds_point first, const std::string& first_abrev,
|
seconds_point first, const std::string& first_abbrev,
|
||||||
seconds_point last, const std::string& last_abrev,
|
seconds_point last, const std::string& last_abbrev,
|
||||||
seconds_point time_sys);
|
seconds_point time_sys);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,25 +63,25 @@ inline
|
|||||||
nonexistent_local_time::nonexistent_local_time(
|
nonexistent_local_time::nonexistent_local_time(
|
||||||
std::chrono::time_point<std::chrono::system_clock,
|
std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
seconds_point first, const std::string& first_abrev,
|
seconds_point first, const std::string& first_abbrev,
|
||||||
seconds_point last, const std::string& last_abrev,
|
seconds_point last, const std::string& last_abbrev,
|
||||||
seconds_point time_sys)
|
seconds_point time_sys)
|
||||||
: std::runtime_error(make_msg(tp, first, first_abrev, last, last_abrev, time_sys))
|
: std::runtime_error(make_msg(tp, first, first_abbrev, last, last_abbrev, time_sys))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
std::string
|
std::string
|
||||||
nonexistent_local_time::make_msg(std::chrono::time_point<std::chrono::system_clock,
|
nonexistent_local_time::make_msg(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
seconds_point first, const std::string& first_abrev,
|
seconds_point first, const std::string& first_abbrev,
|
||||||
seconds_point last, const std::string& last_abrev,
|
seconds_point last, const std::string& last_abbrev,
|
||||||
seconds_point time_sys)
|
seconds_point time_sys)
|
||||||
{
|
{
|
||||||
using namespace date;
|
using namespace date;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << tp << " is in a gap between\n"
|
os << tp << " is in a gap between\n"
|
||||||
<< first << ' ' << first_abrev << " and\n"
|
<< first << ' ' << first_abbrev << " and\n"
|
||||||
<< last << ' ' << last_abrev
|
<< last << ' ' << last_abbrev
|
||||||
<< " which are both equivalent to\n"
|
<< " which are both equivalent to\n"
|
||||||
<< time_sys << " UTC";
|
<< time_sys << " UTC";
|
||||||
return os.str();
|
return os.str();
|
||||||
@@ -95,9 +95,9 @@ public:
|
|||||||
ambiguous_local_time(std::chrono::time_point<std::chrono::system_clock,
|
ambiguous_local_time(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
std::chrono::seconds first_offset,
|
std::chrono::seconds first_offset,
|
||||||
const std::string& first_abrev,
|
const std::string& first_abbrev,
|
||||||
std::chrono::seconds second_offset,
|
std::chrono::seconds second_offset,
|
||||||
const std::string& second_abrev);
|
const std::string& second_abbrev);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@@ -105,8 +105,8 @@ private:
|
|||||||
std::string
|
std::string
|
||||||
make_msg(std::chrono::time_point<std::chrono::system_clock,
|
make_msg(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
std::chrono::seconds first_offset, const std::string& first_abrev,
|
std::chrono::seconds first_offset, const std::string& first_abbrev,
|
||||||
std::chrono::seconds second_offset, const std::string& second_abrev);
|
std::chrono::seconds second_offset, const std::string& second_abbrev);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@@ -115,11 +115,11 @@ ambiguous_local_time::ambiguous_local_time(
|
|||||||
std::chrono::time_point<std::chrono::system_clock,
|
std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
std::chrono::seconds first_offset,
|
std::chrono::seconds first_offset,
|
||||||
const std::string& first_abrev,
|
const std::string& first_abbrev,
|
||||||
std::chrono::seconds second_offset,
|
std::chrono::seconds second_offset,
|
||||||
const std::string& second_abrev)
|
const std::string& second_abbrev)
|
||||||
: std::runtime_error(make_msg(tp, first_offset, first_abrev, second_offset,
|
: std::runtime_error(make_msg(tp, first_offset, first_abbrev, second_offset,
|
||||||
second_abrev))
|
second_abbrev))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@@ -127,15 +127,15 @@ std::string
|
|||||||
ambiguous_local_time::make_msg(std::chrono::time_point<std::chrono::system_clock,
|
ambiguous_local_time::make_msg(std::chrono::time_point<std::chrono::system_clock,
|
||||||
std::chrono::duration<Rep, Period>> tp,
|
std::chrono::duration<Rep, Period>> tp,
|
||||||
std::chrono::seconds first_offset,
|
std::chrono::seconds first_offset,
|
||||||
const std::string& first_abrev,
|
const std::string& first_abbrev,
|
||||||
std::chrono::seconds second_offset,
|
std::chrono::seconds second_offset,
|
||||||
const std::string& second_abrev)
|
const std::string& second_abbrev)
|
||||||
{
|
{
|
||||||
using namespace date;
|
using namespace date;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << tp << " is ambiguous. It could be\n"
|
os << tp << " is ambiguous. It could be\n"
|
||||||
<< tp << ' ' << first_abrev << " == " << tp - first_offset << " UTC or\n"
|
<< tp << ' ' << first_abbrev << " == " << tp - first_offset << " UTC or\n"
|
||||||
<< tp << ' ' << second_abrev << " == " << tp - second_offset << " UTC";
|
<< tp << ' ' << second_abbrev << " == " << tp - second_offset << " UTC";
|
||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -164,7 +164,7 @@ struct Zone::zonelet
|
|||||||
seconds_point until_std_;
|
seconds_point until_std_;
|
||||||
seconds_point until_loc_;
|
seconds_point until_loc_;
|
||||||
std::chrono::minutes initial_save_{};
|
std::chrono::minutes initial_save_{};
|
||||||
std::string initial_abrev_;
|
std::string initial_abbrev_;
|
||||||
std::pair<const Rule*, date::year> first_rule_{nullptr, date::year::min()};
|
std::pair<const Rule*, date::year> first_rule_{nullptr, date::year::min()};
|
||||||
std::pair<const Rule*, date::year> last_rule_{nullptr, date::year::max()};
|
std::pair<const Rule*, date::year> last_rule_{nullptr, date::year::max()};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user