File indexing completed on 2026-05-03 08:13:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___CXX03___CHRONO_FILE_CLOCK_H
0011 #define _LIBCPP___CXX03___CHRONO_FILE_CLOCK_H
0012
0013 #include <__cxx03/__chrono/duration.h>
0014 #include <__cxx03/__chrono/system_clock.h>
0015 #include <__cxx03/__chrono/time_point.h>
0016 #include <__cxx03/__config>
0017 #include <__cxx03/ratio>
0018
0019 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0020 # pragma GCC system_header
0021 #endif
0022
0023 #ifndef _LIBCPP_CXX03_LANG
0024 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
0025 struct _FilesystemClock;
0026 _LIBCPP_END_NAMESPACE_FILESYSTEM
0027 #endif
0028
0029 #if _LIBCPP_STD_VER >= 20
0030
0031 _LIBCPP_BEGIN_NAMESPACE_STD
0032
0033 namespace chrono {
0034
0035
0036 using file_clock = filesystem::_FilesystemClock;
0037
0038 template <class _Duration>
0039 using file_time = time_point<file_clock, _Duration>;
0040
0041 }
0042
0043 _LIBCPP_END_NAMESPACE_STD
0044
0045 #endif
0046
0047 #ifndef _LIBCPP_CXX03_LANG
0048 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
0049 struct _FilesystemClock {
0050 # if !defined(_LIBCPP_HAS_NO_INT128)
0051 typedef __int128_t rep;
0052 typedef nano period;
0053 # else
0054 typedef long long rep;
0055 typedef nano period;
0056 # endif
0057
0058 typedef chrono::duration<rep, period> duration;
0059 typedef chrono::time_point<_FilesystemClock> time_point;
0060
0061 _LIBCPP_EXPORTED_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;
0062
0063 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI static time_point now() noexcept;
0064
0065 # if _LIBCPP_STD_VER >= 20
0066 template <class _Duration>
0067 _LIBCPP_HIDE_FROM_ABI static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {
0068 return chrono::sys_time<_Duration>(__t.time_since_epoch());
0069 }
0070
0071 template <class _Duration>
0072 _LIBCPP_HIDE_FROM_ABI static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {
0073 return chrono::file_time<_Duration>(__t.time_since_epoch());
0074 }
0075 # endif
0076 };
0077 _LIBCPP_END_NAMESPACE_FILESYSTEM
0078 #endif
0079
0080 #endif