Debian Codegraph @

libcxx/modules/std/chrono.inc

raw
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9
10 export namespace std {
11
12 namespace chrono {
13 using std::chrono::duration;
14 using std::chrono::time_point;
15
16 } // namespace chrono
17
18 using std::common_type;
19
20 namespace chrono {
21
22 // [time.traits], customization traits
23 using std::chrono::treat_as_floating_point;
24 using std::chrono::treat_as_floating_point_v;
25
26 using std::chrono::duration_values;
27
28 using std::chrono::is_clock;
29 using std::chrono::is_clock_v;
30
31 // [time.duration.nonmember], duration arithmetic
32 using std::chrono::operator+;
33 using std::chrono::operator-;
34 using std::chrono::operator*;
35 using std::chrono::operator/;
36 using std::chrono::operator%;
37
38 // [time.duration.comparisons], duration comparisons
39 using std::chrono::operator==;
40 using std::chrono::operator<;
41 using std::chrono::operator>;
42 using std::chrono::operator<=;
43 using std::chrono::operator>=;
44 using std::chrono::operator<=>;
45
46 // [time.duration.cast], conversions
47 using std::chrono::ceil;
48 using std::chrono::duration_cast;
49 using std::chrono::floor;
50 using std::chrono::round;
51
52 // [time.duration.io], duration I/O
53 #if _LIBCPP_HAS_LOCALIZATION
54 using std::chrono::operator<<;
55 #endif
56 // using std::chrono::from_stream;
57
58 // convenience typedefs
59 using std::chrono::days;
60 using std::chrono::hours;
61 using std::chrono::microseconds;
62 using std::chrono::milliseconds;
63 using std::chrono::minutes;
64 using std::chrono::months;
65 using std::chrono::nanoseconds;
66 using std::chrono::seconds;
67 using std::chrono::weeks;
68 using std::chrono::years;
69
70 // [time.point.nonmember], time_point arithmetic
71
72 // [time.point.comparisons], time_point comparisons
73
74 // [time.point.cast], conversions
75 using std::chrono::time_point_cast;
76
77 // [time.duration.alg], specialized algorithms
78 using std::chrono::abs;
79
80 // [time.clock.system], class system_clock
81 using std::chrono::system_clock;
82
83 using std::chrono::sys_days;
84 using std::chrono::sys_seconds;
85 using std::chrono::sys_time;
86
87 #if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
88 # ifdef _LIBCPP_ENABLE_EXPERIMENTAL
89
90 // [time.clock.utc], class utc_clock
91 using std::chrono::utc_clock;
92
93 using std::chrono::utc_seconds;
94 using std::chrono::utc_time;
95
96 using std::chrono::leap_second_info;
97
98 using std::chrono::get_leap_second_info;
99
100 // [time.clock.tai], class tai_clock
101 using std::chrono::tai_clock;
102
103 using std::chrono::tai_seconds;
104 using std::chrono::tai_time;
105
106 // [time.clock.gps], class gps_clock
107 using std::chrono::gps_clock;
108
109 using std::chrono::gps_seconds;
110 using std::chrono::gps_time;
111 # endif // _LIBCPP_ENABLE_EXPERIMENTAL
112 #endif // _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
113
114 // [time.clock.file], type file_clock
115 using std::chrono::file_clock;
116
117 using std::chrono::file_time;
118
119 #if _LIBCPP_HAS_MONOTONIC_CLOCK
120 // [time.clock.steady], class steady_clock
121 using std::chrono::steady_clock;
122 #endif
123
124 // [time.clock.hires], class high_resolution_clock
125 using std::chrono::high_resolution_clock;
126
127 // [time.clock.local], local time
128 using std::chrono::local_days;
129 using std::chrono::local_seconds;
130 using std::chrono::local_t;
131 using std::chrono::local_time;
132
133 // [time.clock.cast], time_point conversions
134 // using std::chrono::clock_time_conversion;
135
136 // using std::chrono::clock_cast;
137
138 // [time.cal.last], class last_spec
139 using std::chrono::last_spec;
140
141 // [time.cal.day], class day
142 using std::chrono::day;
143
144 // [time.cal.month], class month
145 using std::chrono::month;
146
147 // [time.cal.year], class year
148 using std::chrono::year;
149
150 // [time.cal.wd], class weekday
151 using std::chrono::weekday;
152
153 // [time.cal.wdidx], class weekday_indexed
154 using std::chrono::weekday_indexed;
155
156 // [time.cal.wdlast], class weekday_last
157 using std::chrono::weekday_last;
158
159 // [time.cal.md], class month_day
160 using std::chrono::month_day;
161
162 // [time.cal.mdlast], class month_day_last
163 using std::chrono::month_day_last;
164
165 // [time.cal.mwd], class month_weekday
166 using std::chrono::month_weekday;
167
168 // [time.cal.mwdlast], class month_weekday_last
169 using std::chrono::month_weekday_last;
170
171 // [time.cal.ym], class year_month
172 using std::chrono::year_month;
173
174 // [time.cal.ymd], class year_month_day
175 using std::chrono::year_month_day;
176
177 // [time.cal.ymdlast], class year_month_day_last
178 using std::chrono::year_month_day_last;
179
180 // [time.cal.ymwd], class year_month_weekday
181 using std::chrono::year_month_weekday;
182
183 // [time.cal.ymwdlast], class year_month_weekday_last
184 using std::chrono::year_month_weekday_last;
185
186 // [time.cal.operators], civil calendar conventional syntax operators
187
188 // [time.hms], class template hh_mm_ss
189 using std::chrono::hh_mm_ss;
190
191 // [time.12], 12/24 hour functions
192 using std::chrono::is_am;
193 using std::chrono::is_pm;
194 using std::chrono::make12;
195 using std::chrono::make24;
196
197 #ifdef _LIBCPP_ENABLE_EXPERIMENTAL
198
199 # if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
200
201 // [time.zone.db], time zone database
202 using std::chrono::tzdb;
203 using std::chrono::tzdb_list;
204
205 // [time.zone.db.access], time zone database access
206 using std::chrono::current_zone;
207 using std::chrono::get_tzdb;
208 using std::chrono::get_tzdb_list;
209 using std::chrono::locate_zone;
210
211 // [time.zone.db.remote], remote time zone database support
212 using std::chrono::reload_tzdb;
213 using std::chrono::remote_version;
214
215 # endif // _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
216
217 // [time.zone.exception], exception classes
218 using std::chrono::ambiguous_local_time;
219 using std::chrono::nonexistent_local_time;
220
221 // [time.zone.info], information classes
222 using std::chrono::local_info;
223 using std::chrono::sys_info;
224
225 # if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
226
227 // [time.zone.timezone], class time_zone
228 using std::chrono::choose;
229 using std::chrono::time_zone;
230
231 // [time.zone.zonedtraits], class template zoned_traits
232 using std::chrono::zoned_traits;
233
234 // [time.zone.zonedtime], class template zoned_time
235 using std::chrono::zoned_time;
236
237 using std::chrono::zoned_seconds;
238
239 // [time.zone.leap], leap second support
240 using std::chrono::leap_second;
241
242 // [time.zone.link], class time_zone_link
243 using std::chrono::time_zone_link;
244
245 # if 0
246 // [time.format], formatting
247 using std::chrono::local_time_format;
248 # endif
249 # endif // _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION
250 #endif // _LIBCPP_ENABLE_EXPERIMENTAL
251
252 } // namespace chrono
253
254 #if _LIBCPP_HAS_LOCALIZATION
255 using std::formatter;
256 #endif
257
258 namespace chrono {
259 // using std::chrono::parse;
260
261 // calendrical constants
262 using std::chrono::last;
263
264 using std::chrono::Friday;
265 using std::chrono::Monday;
266 using std::chrono::Saturday;
267 using std::chrono::Sunday;
268 using std::chrono::Thursday;
269 using std::chrono::Tuesday;
270 using std::chrono::Wednesday;
271
272 using std::chrono::April;
273 using std::chrono::August;
274 using std::chrono::December;
275 using std::chrono::February;
276 using std::chrono::January;
277 using std::chrono::July;
278 using std::chrono::June;
279 using std::chrono::March;
280 using std::chrono::May;
281 using std::chrono::November;
282 using std::chrono::October;
283 using std::chrono::September;
284
285 } // namespace chrono
286
287 #if _LIBCPP_STD_VER >= 26
288 using std::hash;
289 #endif
290
291 } // namespace std
292 export namespace std::inline literals::inline chrono_literals {
293 // [time.duration.literals], suffixes for duration literals
294 using std::literals::chrono_literals::operator""h;
295 using std::literals::chrono_literals::operator""min;
296 using std::literals::chrono_literals::operator""s;
297 using std::literals::chrono_literals::operator""ms;
298 using std::literals::chrono_literals::operator""us;
299 using std::literals::chrono_literals::operator""ns;
300
301 // [using std::literals::chrono_literals::.cal.day.nonmembers], non-member functions
302 using std::literals::chrono_literals::operator""d;
303
304 // [using std::literals::chrono_literals::.cal.year.nonmembers], non-member functions
305 using std::literals::chrono_literals::operator""y;
306 } // namespace std::inline literals::inline chrono_literals