You.i Engine
YiTimeConversion.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_TIME_CONVERSION_H_
3 #define _YI_TIME_CONVERSION_H_
4 
5 #include "utility/YiString.h"
6 
13 {
14 public:
15  enum class Format
16  {
17  ZeroPadded = 0,
18  Unpadded
19  };
20 
24  static CYIString TimeIntervalToString(uint64_t timeSec, Format timeSpanFormat);
25 
33  static CYIString TimeIntervalToString(uint64_t timeSec, const CYIString &format);
34 
38  static bool HasHours(uint64_t timeSec);
39 
43  static bool HasMinutes(uint64_t timeSec);
44 
48  static bool HasSeconds(uint64_t timeSec);
49 
55  static bool StringToTimeInterval(const CYIString &timeSpan, Format timeSpanFormat, uint64_t *pTimeSec);
56 
57 private:
61  static bool IsValidCharacter(char32_t value);
62 
66  static CYIString ReplaceWithValues(CYIString timeFormatString, CYIString timeValueString, uint32_t iterations, uint32_t position);
67 };
68 
71 #endif // _YI_TIME_CONVERSION_H_
static bool HasHours(uint64_t timeSec)
static bool HasMinutes(uint64_t timeSec)
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
static bool HasSeconds(uint64_t timeSec)
Format
Definition: YiTimeConversion.h:15
Definition: YiTimeConversion.h:12
static CYIString TimeIntervalToString(uint64_t timeSec, Format timeSpanFormat)
static bool StringToTimeInterval(const CYIString &timeSpan, Format timeSpanFormat, uint64_t *pTimeSec)