std::chrono::file_clock
來自 cppreference.com
定義於標頭檔案 <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 的格式化支援(類模板特化) |
[編輯] 成員型別
成員型別 | 定義 |
rep
|
帶符號算術型別,表示時鐘持續時間內的“滴答”數 |
period
|
一個 std::ratio 型別,表示時鐘的“滴答”週期,以秒為單位 |
duration
|
std::chrono::duration<rep, period>,能夠表示負持續時間 |
time_point
|
std::chrono::time_point<std::chrono::file_clock> |
[編輯] 成員常量
constexpr bool is_steady [靜態] |
true 如果計時器滴答之間的間隔始終是常量,即 now() 的呼叫返回的值即使在外部時鐘調整的情況下也單調遞增,否則為 false (public static 成員常量) |
[編輯] 成員函式
file_clock
提供了以下兩對靜態成員函式中的一對
-
to_utc
和from_utc
;或 -
to_sys
和from_sys
。
[靜態] |
返回表示當前時間點的 std::chrono::time_point (public static member function) |
[static] (可選) |
在 file_time 和 utc_time 之間轉換(public static member function) |
[static] (可選) |
在 file_time 和 sys_time 之間轉換(public static member function) |