From Jason Turner

[time.clock.file]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmppd5ym2yb/{from.md → to.md} +84 -0
tmp/tmppd5ym2yb/{from.md → to.md} RENAMED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Type `file_clock` <a id="time.clock.file">[[time.clock.file]]</a>
2
+
3
+ #### Overview <a id="time.clock.file.overview">[[time.clock.file.overview]]</a>
4
+
5
+ ``` cpp
6
+ namespace std::chrono {
7
+ using file_clock = see below;
8
+ }
9
+ ```
10
+
11
+ `file_clock` is an alias for a type meeting the *Cpp17TrivialClock*
12
+ requirements [[time.clock.req]], and using a signed arithmetic type for
13
+ `file_clock::rep`. `file_clock` is used to create the `time_point`
14
+ system used for `file_time_type` [[filesystems]]. Its epoch is
15
+ unspecified, and `noexcept(file_clock::now())` is `true`.
16
+
17
+ [*Note 1*: The type that `file_clock` denotes may be in a different
18
+ namespace than `std::chrono`, such as `std::filesystem`. — *end note*]
19
+
20
+ #### Member functions <a id="time.clock.file.members">[[time.clock.file.members]]</a>
21
+
22
+ The type denoted by `file_clock` provides precisely one of the following
23
+ two sets of static member functions:
24
+
25
+ ``` cpp
26
+ template<class Duration>
27
+ static sys_time<see below>
28
+ to_sys(const file_time<Duration>&);
29
+ template<class Duration>
30
+ static file_time<see below>
31
+ from_sys(const sys_time<Duration>&);
32
+ ```
33
+
34
+ or:
35
+
36
+ ``` cpp
37
+ template<class Duration>
38
+ static utc_time<see below>
39
+ to_utc(const file_time<Duration>&);
40
+ template<class Duration>
41
+ static file_time<see below>
42
+ from_utc(const utc_time<Duration>&);
43
+ ```
44
+
45
+ These member functions shall provide `time_point` conversions consistent
46
+ with those specified by `utc_clock`, `tai_clock`, and `gps_clock`. The
47
+ `Duration` of the resultant `time_point` is computed from the `Duration`
48
+ of the input `time_point`.
49
+
50
+ #### Non-member functions <a id="time.clock.file.nonmembers">[[time.clock.file.nonmembers]]</a>
51
+
52
+ ``` cpp
53
+ template<class charT, class traits, class Duration>
54
+ basic_ostream<charT, traits>&
55
+ operator<<(basic_ostream<charT, traits>& os, const file_time<Duration>& t);
56
+ ```
57
+
58
+ *Effects:* Equivalent to:
59
+
60
+ ``` cpp
61
+ return os << format(STATICALLY-WIDEN<charT>("{:%F %T}"), t);
62
+ ```
63
+
64
+ ``` cpp
65
+ template<class charT, class traits, class Duration, class Alloc = allocator<charT>>
66
+ basic_istream<charT, traits>&
67
+ from_stream(basic_istream<charT, traits>& is, const charT* fmt,
68
+ file_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr,
69
+ minutes* offset = nullptr);
70
+ ```
71
+
72
+ *Effects:* Attempts to parse the input stream `is` into the `file_time`
73
+ `tp` using the format flags given in the NTCTS `fmt` as specified in
74
+ [[time.parse]]. If the parse fails to decode a valid date,
75
+ `is.setstate(ios_base::failbit)` is called and `tp` is not modified. If
76
+ `%Z` is used and successfully parsed, that value will be assigned to
77
+ `*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
78
+ used and successfully parsed, that value will be assigned to `*offset`
79
+ if `offset` is non-null. Additionally, the parsed offset will be
80
+ subtracted from the successfully parsed timestamp prior to assigning
81
+ that difference to `tp`.
82
+
83
+ *Returns:* `is`.
84
+