updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
@ -55,6 +55,8 @@ void get_local_time_now(struct tm &local_time);
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
auto strptime(const char *s, const char *f, struct tm *tm) -> const char *;
|
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 unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME;
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
|
@ -58,11 +58,11 @@ auto traverse_directory(
|
|||||||
|
|
||||||
::FindClose(find);
|
::FindClose(find);
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
auto *root = opendir(path.c_str());
|
auto *root = opendir(std::string{path}.c_str());
|
||||||
if (root == nullptr) {
|
if (root == nullptr) {
|
||||||
throw std::runtime_error("failed to open directory|" + std::string{path} +
|
throw std::runtime_error(
|
||||||
'|' +
|
"failed to open directory|" + std::string{path} + '|' +
|
||||||
std::to_string(utils::get_last_error_code()));
|
std::to_string(repertory::utils::get_last_error_code()));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent *de{};
|
struct dirent *de{};
|
||||||
|
@ -66,6 +66,10 @@ auto strptime(const char *s, const char *f, struct tm *tm) -> const char * {
|
|||||||
return reinterpret_cast<const char *>(s + input.tellg());
|
return reinterpret_cast<const char *>(s + input.tellg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto time64_to_unix_time(const __time64_t &time) -> std::uint64_t {
|
||||||
|
return static_cast<std::uint64_t>(time * NANOS_PER_SECOND);
|
||||||
|
}
|
||||||
|
|
||||||
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
|
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
|
||||||
auto unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME {
|
auto unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME {
|
||||||
auto win_time =
|
auto win_time =
|
||||||
|
Reference in New Issue
Block a user