std::chrono::file_clock
出自 cppreference.cn
定义于头文件 <chrono> |
||
using file_clock = /* 见下方 */; |
(自 C++20 起) | |
std::chrono::file_clock
是用于 std::filesystem::file_time_type 的时钟的别名。其纪元未指定。
file_clock
满足 TrivialClock 的要求。
目录 |
时间点族
定义于命名空间 std::chrono |
||
template<class Duration> using file_time = std::chrono::time_point<std::chrono::file_clock, Duration>; |
(自 C++20 起) | |
对 file_time 执行流输出(函数模板) | |
根据提供的格式从流中解析 file_time (函数模板) | |
对 file_time 的格式化支持(类模板特化) |
[edit] 成员类型
成员类型 | 定义 |
rep
|
有符号算术类型,表示时钟持续时间中的嘀嗒数 |
period
|
一个 std::ratio 类型,表示时钟的嘀嗒周期,以秒为单位 |
duration
|
std::chrono::duration<rep, period>,能够表示负持续时间 |
time_point
|
std::chrono::time_point<std::chrono::file_clock> |
[edit] 成员常量
constexpr bool is_steady [静态] |
true 如果嘀嗒之间的时间始终恒定,即调用 now() 返回的值单调递增,即使在某些外部时钟调整的情况下,否则为 false (公共静态成员常量) |
[edit] 成员函数
file_clock
提供了以下两对静态成员函数中的恰好一对
-
to_utc
和from_utc
;或 -
to_sys
和from_sys
。
[静态] |
返回一个 std::chrono::time_point,表示当前时间点 (公共静态成员函数) |
[静态] (可选) |
在 file_time 和 utc_time 之间转换(公共静态成员函数) |
[静态] (可选) |
在 file_time 和 sys_time 之间转换(公共静态成员函数) |