Path: blob/main/contrib/llvm-project/libcxx/include/__chrono/file_clock.h
35262 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___CHRONO_FILE_CLOCK_H10#define _LIBCPP___CHRONO_FILE_CLOCK_H1112#include <__chrono/duration.h>13#include <__chrono/system_clock.h>14#include <__chrono/time_point.h>15#include <__config>16#include <ratio>1718#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19# pragma GCC system_header20#endif2122#ifndef _LIBCPP_CXX03_LANG23_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM24struct _FilesystemClock;25_LIBCPP_END_NAMESPACE_FILESYSTEM26#endif // !_LIBCPP_CXX03_LANG2728#if _LIBCPP_STD_VER >= 202930_LIBCPP_BEGIN_NAMESPACE_STD3132namespace chrono {3334// [time.clock.file], type file_clock35using file_clock = filesystem::_FilesystemClock;3637template <class _Duration>38using file_time = time_point<file_clock, _Duration>;3940} // namespace chrono4142_LIBCPP_END_NAMESPACE_STD4344#endif // _LIBCPP_STD_VER >= 204546#ifndef _LIBCPP_CXX03_LANG47_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM48struct _FilesystemClock {49# if !defined(_LIBCPP_HAS_NO_INT128)50typedef __int128_t rep;51typedef nano period;52# else53typedef long long rep;54typedef nano period;55# endif5657typedef chrono::duration<rep, period> duration;58typedef chrono::time_point<_FilesystemClock> time_point;5960_LIBCPP_EXPORTED_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14 const bool is_steady = false;6162_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI static time_point now() noexcept;6364# if _LIBCPP_STD_VER >= 2065template <class _Duration>66_LIBCPP_HIDE_FROM_ABI static chrono::sys_time<_Duration> to_sys(const chrono::file_time<_Duration>& __t) {67return chrono::sys_time<_Duration>(__t.time_since_epoch());68}6970template <class _Duration>71_LIBCPP_HIDE_FROM_ABI static chrono::file_time<_Duration> from_sys(const chrono::sys_time<_Duration>& __t) {72return chrono::file_time<_Duration>(__t.time_since_epoch());73}74# endif // _LIBCPP_STD_VER >= 2075};76_LIBCPP_END_NAMESPACE_FILESYSTEM77#endif // !_LIBCPP_CXX03_LANG7879#endif // _LIBCPP___CHRONO_FILE_CLOCK_H808182