forked from HowardHinnant/date
Add format and parse overloads for durations
This commit is contained in:
190
tz.html
190
tz.html
@@ -26,7 +26,7 @@
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
|
||||
2016-11-25<br/>
|
||||
2017-01-28<br/>
|
||||
</address>
|
||||
<hr/>
|
||||
<h1 align=center>Time Zone Database Parser</h1>
|
||||
@@ -1995,6 +1995,15 @@ make_zoned(const std::string& name, const sys_time<Duration>& st)
|
||||
<a name="to_stream"></a><h3><code>to_stream</code></h3>
|
||||
<blockquote>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, , class Rep, class Period>
|
||||
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>
|
||||
void
|
||||
@@ -2062,6 +2071,10 @@ 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 Rep, class Period>
|
||||
std::basic_string<CharT>
|
||||
format(const std::basic_string<CharT, Traits>& fmt, const std::chrono::duration<Rep, Period>& d);
|
||||
|
||||
// const CharT* formats
|
||||
|
||||
template <class CharT, class Duration>
|
||||
@@ -2087,6 +2100,10 @@ format(const std::locale& loc, const CharT* format, const sys_time<Durati
|
||||
template <class CharT, class Duration>
|
||||
std::basic_string<class CharT>
|
||||
format(const CharT* format, const sys_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)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
@@ -2175,124 +2192,124 @@ For the overloads taking a <code>zoned_time</code> it is the value returned by
|
||||
<a name="parse"></a><h3><code>parse</code></h3>
|
||||
<blockquote>
|
||||
<p>
|
||||
One can parse in a <code>sys_time<Duration></code> or a
|
||||
<code>local_time<Duration></code>. Optionally, one can also pass in a reference
|
||||
One can parse in a <code>sys_time<Duration></code>,
|
||||
<code>local_time<Duration></code>, or a <code>duration<Rep, Period></code>.
|
||||
Optionally, one can also pass in a reference
|
||||
to a <code>std::string</code> in order to capture the time zone abbreviation, or one
|
||||
can pass in a reference to a <code>std::chrono::minutes</code> to capture a time zone
|
||||
UTC offset (formatted as <code>+0000</code>), or one can pass in both in either order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Each of the functions below return an unspecified <i>manipulator</i> which can be used
|
||||
to extract the desired information from a stream.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp);
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev, std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, sys_time<Duration>& tp,
|
||||
std::chrono::minutes& offset, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp);
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev, std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is,
|
||||
const std::basic_string<CharT, Traits>& format, local_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const std::basic_string<CharT, Traits>& format, local_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,
|
||||
std::chrono::duration<Rep, Period>& d);
|
||||
|
||||
// const CharT* formats
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format, sys_time<Duration>& tp);
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, sys_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, sys_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format, sys_time<Duration>& tp,
|
||||
std::chrono::minutes& offset);
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, sys_time<Duration>& tp, std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, sys_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev, std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format, sys_time<Duration>& tp,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, sys_time<Duration>& tp,
|
||||
std::chrono::minutes& offset, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format,
|
||||
local_time<Duration>& tp);
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, local_time<Duration>& tp);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format,
|
||||
local_time<Duration>& tp, std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format,
|
||||
local_time<Duration>& tp, std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format,
|
||||
local_time<Duration>& tp, std::basic_string<CharT, Traits>& abbrev,
|
||||
std::chrono::minutes& offset);
|
||||
|
||||
template <class CharT, class Traits, class Duration>
|
||||
void
|
||||
parse(std::basic_istream<CharT, Traits>& is, const CharT* format,
|
||||
local_time<Duration>& tp, std::chrono::minutes& offset,
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, local_time<Duration>& tp,
|
||||
std::basic_string<CharT, Traits>& abbrev);
|
||||
|
||||
template <class Duration, class CharT>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, local_time<Duration>& tp, std::chrono::minutes& offset);
|
||||
|
||||
template <class Duration, class CharT, class Traits>
|
||||
<i>unspecified istream manipulator</i>
|
||||
parse(const CharT* format, local_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, local_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);
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
@@ -2363,13 +2380,6 @@ or <code>local_time</code>, one could make a list of potential <code>time_zone</
|
||||
Given a UTC offset, one might even narrow that list down further.
|
||||
</p>
|
||||
</blockquote>
|
||||
<p>Furthermore, for every signature
|
||||
<code>parse(std::basic_istream<CharT, Traits>& is, Args...)</code> there exists
|
||||
an input manipulator <code>parse(Args...)</code> that can be used like this:
|
||||
</p>
|
||||
<pre>
|
||||
istream >> parse("%F %T", tp);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<a name="utc_clock"></a><h3><code>utc_clock</code></h3>
|
||||
|
Reference in New Issue
Block a user