mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-29 01:30:02 +08:00
Rewrite format and parse in terms of detail::fields<Duration>
* Add format and parse to utc_time<Duration>. * Added more tests.
This commit is contained in:
parent
fa86a381d1
commit
4f89141e56
69
date.html
69
date.html
@ -6326,6 +6326,7 @@ time_of_day<std::chrono::hours>
|
||||
public:
|
||||
using precision = std::chrono::hours;
|
||||
|
||||
constexpr time_of_day() noexcept;
|
||||
constexpr explicit time_of_day(std::chrono::hours since_midnight) noexcept;
|
||||
|
||||
constexpr std::chrono::hours hours() const noexcept;
|
||||
@ -6339,6 +6340,21 @@ public:
|
||||
};
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
constexpr time_of_day<std::chrono::hours>::time_of_day() noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Effects:</i> Constructs an object of type <code>time_of_day</code> in 24-hour format
|
||||
corresponding to 00:00:00 hours after 00:00:00.
|
||||
</p>
|
||||
<p>
|
||||
<i>Postconditions:</i> <code>hours()</code> returns <code>0h</code>.
|
||||
<code>mode()</code> returns <code>0</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constexpr explicit time_of_day<std::chrono::hours>::time_of_day(std::chrono::hours since_midnight) noexcept;
|
||||
</pre>
|
||||
@ -6453,6 +6469,7 @@ time_of_day<std::chrono::minutes>
|
||||
public:
|
||||
using precision = std::chrono::minutes;
|
||||
|
||||
constexpr time_of_day() noexcept;
|
||||
constexpr explicit time_of_day(std::chrono::minutes since_midnight) noexcept;
|
||||
|
||||
constexpr std::chrono::hours hours() const noexcept;
|
||||
@ -6467,6 +6484,21 @@ public:
|
||||
};
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
constexpr time_of_day<std::chrono::minutes>::time_of_day() noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Effects:</i> Constructs an object of type <code>time_of_day</code> in 24-hour format
|
||||
corresponding to 0 minutes after 00:00:00.
|
||||
</p>
|
||||
<p>
|
||||
<i>Postconditions:</i> <code>hours()</code> returns <code>0h</code>.
|
||||
<code>minutes()</code> returns <code>0min</code>. <code>mode()</code> returns <code>0</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constexpr explicit time_of_day<std::chrono::minutes>::time_of_day(std::chrono::minutes since_midnight) noexcept;
|
||||
</pre>
|
||||
@ -6593,6 +6625,7 @@ time_of_day<std::chrono::seconds>
|
||||
public:
|
||||
using precision = std::chrono::seconds;
|
||||
|
||||
constexpr time_of_day() noexcept;
|
||||
constexpr explicit time_of_day(std::chrono::seconds since_midnight) noexcept;
|
||||
|
||||
constexpr std::chrono::hours hours() const noexcept;
|
||||
@ -6608,6 +6641,22 @@ public:
|
||||
};
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
constexpr time_of_day<std::chrono::seconds>::time_of_day() noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Effects:</i> Constructs an object of type <code>time_of_day</code> in 24-hour format
|
||||
corresponding to 0 seconds after 00:00:00.
|
||||
</p>
|
||||
<p>
|
||||
<i>Postconditions:</i> <code>hours()</code> returns <code>0h</code>.
|
||||
<code>minutes()</code> returns <code>0min</code>. <code>seconds()</code> returns
|
||||
<code>0s</code>. <code>mode()</code> returns <code>0</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constexpr explicit time_of_day<std::chrono::seconds>::time_of_day(std::chrono::seconds since_midnight) noexcept;
|
||||
</pre>
|
||||
@ -6746,6 +6795,7 @@ time_of_day<std::chrono::duration<Rep, Period>>
|
||||
public:
|
||||
using precision = <i>The decimal-based duration used to format</i>
|
||||
|
||||
constexpr time_of_day() noexcept;
|
||||
constexpr explicit time_of_day(std::chrono::duration<Rep, Period> since_midnight) noexcept;
|
||||
|
||||
constexpr std::chrono::hours hours() const noexcept;
|
||||
@ -6766,6 +6816,25 @@ public:
|
||||
This specialization shall not exist unless <code>Period < 1s</code>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
constexpr
|
||||
time_of_day<std::chrono::duration<Rep, Period>>::time_of_day() noexcept;
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Effects:</i> Constructs an object of type <code>time_of_day</code> in 24-hour format
|
||||
corresponding to 0 fractional seconds after 00:00:00.
|
||||
</p>
|
||||
<p>
|
||||
<i>Postconditions:</i> <code>hours()</code> returns <code>0h</code>.
|
||||
<code>minutes()</code> returns <code>0min</code>.
|
||||
<code>seconds()</code> returns <code>0s</code>.
|
||||
<code>subseconds()</code> returns 0 fractional precision seconds.
|
||||
<code>mode()</code> returns <code>0</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
constexpr explicit
|
||||
time_of_day<std::chrono::duration<Rep, Period>>::time_of_day(std::chrono::duration<Rep, Period> since_midnight) noexcept;
|
||||
|
80
tz.html
80
tz.html
@ -26,7 +26,7 @@
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
|
||||
2017-01-28<br/>
|
||||
2017-02-25<br/>
|
||||
</address>
|
||||
<hr/>
|
||||
<h1 align=center>Time Zone Database Parser</h1>
|
||||
@ -2001,8 +2001,6 @@ void
|
||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
const std::chrono::duration<Rep, Period>& d);
|
||||
</pre>
|
||||
<blockquote>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, class Duration>
|
||||
@ -2010,8 +2008,6 @@ void
|
||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
const local_time<Duration>& tp);
|
||||
</pre>
|
||||
<blockquote>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, class Duration>
|
||||
@ -2019,8 +2015,6 @@ void
|
||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
const sys_time<Duration>& tp);
|
||||
</pre>
|
||||
<blockquote>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, class Duration>
|
||||
@ -2028,6 +2022,14 @@ void
|
||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
const zoned_time<Duration>& tp);
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
|
||||
const utc_time<Duration>& tp);
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
These are lower-level functions with respect to <code>format</code>. These functions
|
||||
@ -2071,6 +2073,15 @@ template <class CharT, class Traits, class Duration>
|
||||
std::basic_string<class CharT, class Traits>
|
||||
format(const std::basic_string<class CharT, class Traits>& format, const sys_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
std::basic_string<class CharT, class Traits>
|
||||
format(const std::locale& loc, const std::basic_string<class CharT, class Traits>& format,
|
||||
const utc_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
std::basic_string<class CharT, class Traits>
|
||||
format(const std::basic_string<class CharT, class Traits>& format, const utc_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Rep, class Period>
|
||||
std::basic_string<CharT>
|
||||
format(const std::basic_string<CharT, Traits>& fmt, const std::chrono::duration<Rep, Period>& d);
|
||||
@ -2101,6 +2112,14 @@ template <class CharT, class Duration>
|
||||
std::basic_string<class CharT>
|
||||
format(const CharT* format, const sys_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Duration>
|
||||
std::basic_string<class CharT>
|
||||
format(const std::locale& loc, const CharT* format, const utc_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Duration>
|
||||
std::basic_string<class CharT>
|
||||
format(const CharT* format, const utc_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Rep, class Period>
|
||||
std::basic_string<CharT>
|
||||
format(const CharT* fmt, const std::chrono::duration<Rep, Period>& d)
|
||||
@ -2254,6 +2273,30 @@ template <class Duration, class CharT, class Traits>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
std::chrono::minutes& offset, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, utc_time<Duration>& tp);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, utc_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, utc_time<Duration>& tp,
|
||||
std::chrono::minutes& offset);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, utc_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev, std::chrono::minutes& offset);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, utc_time<Duration>& tp,
|
||||
std::chrono::minutes& offset, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Rep, class Period, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format,
|
||||
@ -2307,6 +2350,29 @@ template <class Duration, class CharT, class Traits>
|
||||
parse(const CharT* format, local_time<Duration>& tp, std::chrono::minutes& offset,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, utc_time<Duration>& tp);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, utc_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, utc_time<Duration>& tp, std::chrono::minutes& offset);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, utc_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev, std::chrono::minutes& offset);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, utc_time<Duration>& tp,
|
||||
std::chrono::minutes& offset, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Rep, class Period, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, std::chrono::duration<Rep, Period>& d);
|
||||
|
Loading…
x
Reference in New Issue
Block a user