LeviLamina
Loading...
Searching...
No Matches
DateManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
7#include "mc/platform/Result.h"
8
9// auto generated forward declare list
10// clang-format off
12// clang-format on
13
14class DateManager : public ::Bedrock::EnableNonOwnerReferences {
15public:
16 // DateManager inner types define
17 enum class TimeZoneType : int {
18 Utc = 0,
19 Local = 1,
20 };
21
22public:
23 // member variables
24 // NOLINTBEGIN
31 // NOLINTEND
32
33#ifdef LL_PLAT_S
34public:
35 // prevent constructor by default
36 DateManager& operator=(DateManager const&);
37 DateManager(DateManager const&);
38 DateManager();
39
40#else // LL_PLAT_C
41public:
42 // prevent constructor by default
43 DateManager& operator=(DateManager const&);
44 DateManager(DateManager const&);
45
46#endif
47public:
48 // virtual functions
49 // NOLINTBEGIN
50#ifdef LL_PLAT_S
51 virtual ~DateManager() /*override*/ = default;
52#else // LL_PLAT_C
53 virtual ~DateManager() /*override*/;
54#endif
55
56 virtual int64 _getUnixTime();
57 // NOLINTEND
58
59public:
60 // member functions
61 // NOLINTBEGIN
62#ifdef LL_PLAT_C
63 MCNAPI DateManager();
64
65 MCNAPI void _sendScheduledCallbacks();
66
67 MCNAPI ::tm getDateTime(::DateManager::TimeZoneType returnType) const;
68
69 MCNAPI int64 getTime() const;
70
71 MCNAPI bool isBetweenDates(::std::string const& start, ::std::string const& end) const;
72
73 MCNAPI bool isInFuture(::std::string const& strTime) const;
74
75 MCNAPI bool isInPast(::std::string const& strTime) const;
76
77 MCNAPI void registerScheduledCallback(::ScheduledCallback callback) const;
78
79 MCNAPI void setTime(int64 time);
80
81 MCNAPI void tick();
82
83 MCNAPI ::std::string toString(::DateManager::TimeZoneType outputType, ::std::string const& format) const;
84
85 MCNAPI ::std::string toString_DateTime(::DateManager::TimeZoneType outputType) const;
86#endif
87 // NOLINTEND
88
89public:
90 // static functions
91 // NOLINTBEGIN
92 MCNAPI static int _parseTime(char const* str, uint64 len, uint* hours, uint* minutes, uint* seconds);
93
94 MCNAPI static int
95 _parseTimeZone(char const* str, uint64 len, ::DateManager::TimeZoneType* type, int* hours, int* minutes);
96
97#ifdef LL_PLAT_C
98 MCNAPI static double daysUntilDate(int64 now, int64 time);
99#endif
100
101 MCNAPI static ::std::string getCurrentTimestampFileName();
102
103 MCNAPI static ::tm getRealDateTime(::DateManager::TimeZoneType returnType);
104
105 MCNAPI static int64 getRealTime();
106
107 MCNAPI static ::Bedrock::Result<int64> parseImfFixdate(::std::string const& dateHeader);
108
109 MCNAPI static bool toDateTime(
110 ::std::string const& strTime,
111 ::tm* result,
112 ::DateManager::TimeZoneType* resultType,
113 int* resultTimeZoneMinutes
114 );
115
116#ifdef LL_PLAT_C
117 MCNAPI static ::tm toDateTime(::std::string const& strTime);
118#endif
119
120 MCNAPI static ::tm toDateTime(int64 time, ::DateManager::TimeZoneType returnType);
121
122 MCNAPI static bool toEpochTime(
123 ::std::string const& strTime,
124 int64* result,
125 ::DateManager::TimeZoneType* resultType,
126 int* resultTimeZoneMinutes
127 );
128
129 MCNAPI static int64 toEpochTime(::std::string const& strTime);
130
131 MCNAPI static int64 toEpochTime(::tm const* dateTime, ::DateManager::TimeZoneType inputType);
132
133 MCNAPI static ::std::string
134 toString(::tm const& time, ::std::string const& format, ::std::optional<::std::locale> const& locale);
135
136 MCNAPI static ::std::string toString(
137 int64 const& time,
138 ::DateManager::TimeZoneType outputType,
139 ::std::string const& format,
140 ::std::optional<::std::locale> const& locale
141 );
142
143#ifdef LL_PLAT_C
144 MCNAPI static ::std::string toString_Date(::tm const& time);
145#endif
146
147 MCNAPI static ::std::string toString_DateTime(::tm const& time, ::DateManager::TimeZoneType outputType);
148
149 MCNAPI static ::std::string toString_DateTime(int64 const& time, ::DateManager::TimeZoneType outputType);
150 // NOLINTEND
151
152public:
153 // constructor thunks
154 // NOLINTBEGIN
155#ifdef LL_PLAT_C
156 MCNAPI void* $ctor();
157#endif
158 // NOLINTEND
159
160public:
161 // destructor thunk
162 // NOLINTBEGIN
163 MCNAPI void $dtor();
164 // NOLINTEND
165
166public:
167 // virtual function thunks
168 // NOLINTBEGIN
169#ifdef LL_PLAT_C
170 MCNAPI int64 $_getUnixTime();
171#endif
172
173
174 // NOLINTEND
175
176public:
177 // vftables
178 // NOLINTBEGIN
179 MCNAPI static void** $vftable();
180 // NOLINTEND
181};
Definition EnableNonOwnerReferences.h:7
static MCAPI int64 toEpochTime(::tm const *dateTime, ::DateManager::TimeZoneType inputType)
static MCAPI void ** $vftable()
static MCAPI ::Bedrock::Result< int64 > parseImfFixdate(::std::string const &dateHeader)
static MCAPI int _parseTimeZone(char const *str, uint64 len, ::DateManager::TimeZoneType *type, int *hours, int *minutes)
static MCAPI ::std::string getCurrentTimestampFileName()
MCAPI void $dtor()
static MCAPI ::tm getRealDateTime(::DateManager::TimeZoneType returnType)
static MCAPI ::std::string toString(::tm const &time, ::std::string const &format, ::std::optional<::std::locale > const &locale)
static MCAPI ::std::string toString_DateTime(::tm const &time, ::DateManager::TimeZoneType outputType)
static MCAPI ::std::string toString_DateTime(int64 const &time, ::DateManager::TimeZoneType outputType)
static MCAPI bool toDateTime(::std::string const &strTime, ::tm *result, ::DateManager::TimeZoneType *resultType, int *resultTimeZoneMinutes)
static MCAPI int64 getRealTime()
static MCAPI ::tm toDateTime(int64 time, ::DateManager::TimeZoneType returnType)
static MCAPI int64 toEpochTime(::std::string const &strTime)
static MCAPI bool toEpochTime(::std::string const &strTime, int64 *result, ::DateManager::TimeZoneType *resultType, int *resultTimeZoneMinutes)
static MCAPI int _parseTime(char const *str, uint64 len, uint *hours, uint *minutes, uint *seconds)
static MCAPI ::std::string toString(int64 const &time, ::DateManager::TimeZoneType outputType, ::std::string const &format, ::std::optional<::std::locale > const &locale)
Definition ScheduledCallback.h:5
Definition Alias.h:14