new_build_system (#18)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
Reviewed-on: #18
This commit is contained in:
@ -25,7 +25,9 @@
|
||||
#include "utils/config.hpp"
|
||||
|
||||
namespace repertory::utils::time {
|
||||
inline constexpr const auto NANOS_PER_SECOND = 1000000000L;
|
||||
inline constexpr const auto NANOS_PER_SECOND{1000000000ULL};
|
||||
inline constexpr const auto WIN32_TIME_CONVERSION{116444736000000000ULL};
|
||||
inline constexpr const auto WIN32_TIME_NANOS_PER_TICK{100ULL};
|
||||
|
||||
#if defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT)
|
||||
[[nodiscard]] inline auto convert_to_utc(time_t time) -> std::time_t {
|
||||
@ -34,11 +36,6 @@ inline constexpr const auto NANOS_PER_SECOND = 1000000000L;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT)
|
||||
|
||||
#if defined(_WIN32)
|
||||
[[nodiscard]] auto
|
||||
filetime_to_unix_time(const FILETIME &file_time) -> std::uint64_t;
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
#if defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT)
|
||||
[[nodiscard]] inline auto get_current_time_utc() -> std::time_t {
|
||||
auto calendar_time = fmt::gmtime(std::time(nullptr));
|
||||
@ -46,8 +43,6 @@ filetime_to_unix_time(const FILETIME &file_time) -> std::uint64_t;
|
||||
}
|
||||
#endif // defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT)
|
||||
|
||||
[[nodiscard]] auto get_file_time_now() -> std::uint64_t;
|
||||
|
||||
void get_local_time_now(struct tm &local_time);
|
||||
|
||||
[[nodiscard]] auto get_time_now() -> std::uint64_t;
|
||||
@ -55,10 +50,20 @@ void get_local_time_now(struct tm &local_time);
|
||||
#if defined(_WIN32)
|
||||
auto strptime(const char *s, const char *f, struct tm *tm) -> const char *;
|
||||
|
||||
[[nodiscard]] auto time64_to_unix_time(const __time64_t &time) -> std::uint64_t;
|
||||
|
||||
[[nodiscard]] auto unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME;
|
||||
|
||||
[[nodiscard]] auto
|
||||
windows_file_time_to_unix_time(FILETIME win_time) -> std::uint64_t;
|
||||
|
||||
[[nodiscard]] auto
|
||||
windows_time_t_to_unix_time(__time64_t win_time) -> std::uint64_t;
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
[[nodiscard]] auto
|
||||
unix_time_to_windows_time(std::uint64_t unix_time) -> std::uint64_t;
|
||||
|
||||
[[nodiscard]] auto
|
||||
windows_time_to_unix_time(std::uint64_t win_time) -> std::uint64_t;
|
||||
} // namespace repertory::utils::time
|
||||
|
||||
#endif // REPERTORY_INCLUDE_UTILS_TIME_HPP_
|
||||
|
Reference in New Issue
Block a user