-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTRIMCORE_Describe_Time.h
32 lines (25 loc) · 1.35 KB
/
TRIMCORE_Describe_Time.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef TRIMCORE_DLL_DESCRIBE_TIME_H
#define TRIMCORE_DLL_DESCRIBE_TIME_H
namespace TRIMCORE {
// Describe std::tm/FILETIME/SYSTEMTIME
// - supported format parameters:
// - D<xxx> - display date, in xxx (optional) format, "db" format is YYYY-MM-DD
// - LD - display long date
// - T<xxx> - display time, in xxx (optional) format, "db" format is HH:MM:SS
// - T24<xxx> - time, force 24 hour format
// - ST - time without seconds
// - ms - display milliseconds
// - L - use user's default locale
// - L<xxx> - use locale xxx, where xxx is either name (en-US) or number 0x0405
// - default format is "D<db>,T24<db>,ms"
inline std::wstring Describe (const std::tm &, DescriptionFormatting * format = nullptr);
inline std::wstring Describe (const FILETIME &, DescriptionFormatting * format = nullptr);
inline std::wstring Describe (const SYSTEMTIME &, DescriptionFormatting * format = nullptr);
// DescriptionLengthEst
// - length of default <db> formatted string: "%04u-%02u-%02u %02u:%02u:%02u.%03u"
inline std::size_t DescriptionLengthEst (const std::tm &) { return 24; }
inline std::size_t DescriptionLengthEst (const FILETIME &) { return 24; }
inline std::size_t DescriptionLengthEst (const SYSTEMTIME &) { return 24; }
}
#include "TRIMCORE_Describe_Time.tcc"
#endif