FileSystemIndexer v0.1.2-beta
File System Indexer - An API to index files from your system
Loading...
Searching...
No Matches
FSI_timeUtils.hpp
Go to the documentation of this file.
1#ifndef INCLUDE_CORE_FSI_TIMEUTILS_HPP_
2#define INCLUDE_CORE_FSI_TIMEUTILS_HPP_
3
4#include <filesystem>
5
6namespace fs = std::filesystem;
7
8#ifdef FSI_OS_WIN32
9# define __FSI_LOCALTIME(_tt, _tm) localtime_r(_tm, _tt)
10#else
11# define __FSI_LOCALTIME(_tt, _tm) localtime_r(_tt, _tm)
12#endif // FSI_OS_WIN32
13
14namespace fsi::utils
15{
16 typedef struct TimeUtils_DateTime
17 {
18 unsigned int hour;
19 unsigned int min;
20 unsigned int sec;
21 unsigned int ms;
22
23 unsigned int year;
24 unsigned int month;
25 unsigned int day;
27
28 /**
29 * @brief Set std::filesystem clock data to an actual usable Date and Time format
30 * @param time Get `std::filesystem::file_time_type` that is to be converted to a usuable time format
31 * @return Date-Time object to be used
32 */
33 TimeUtils_DateTime fsClockDataToDT(const fs::file_time_type &time);
34}
35
36#endif // INCLUDE_CORE_FSI_TIMEUTILS_HPP_
37
struct fsi::utils::TimeUtils_DateTime TimeUtils_DateTime
TimeUtils_DateTime fsClockDataToDT(const fs::file_time_type &time)
Set std::filesystem clock data to an actual usable Date and Time format.