summaryrefslogtreecommitdiff
path: root/Runtime/Utilities/DateTime.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Utilities/DateTime.h')
-rw-r--r--Runtime/Utilities/DateTime.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/Utilities/DateTime.h b/Runtime/Utilities/DateTime.h
new file mode 100644
index 0000000..b747628
--- /dev/null
+++ b/Runtime/Utilities/DateTime.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "Runtime/Serialize/SerializeUtility.h"
+
+struct DateTime
+{
+ // We are wasting memory and serialization
+ // in assetdatabase is wrong because of the alignment!
+ // We do this change in 1.5 because it will force a rebuild of all assets
+ UInt16 highSeconds;
+ UInt16 fraction;
+ UInt32 lowSeconds;
+ DECLARE_SERIALIZE_OPTIMIZE_TRANSFER (DateTime)
+
+ DateTime ();
+
+ friend bool operator < (const DateTime& d0, const DateTime& d1);
+ friend bool operator == (const DateTime& d0, const DateTime& d1);
+ friend bool operator != (const DateTime& d0, const DateTime& d1) { return !(d0 == d1); }
+};
+
+template<class TransferFunction>
+void DateTime::Transfer (TransferFunction& transfer)
+{
+ TRANSFER (highSeconds);
+ TRANSFER (fraction);
+ TRANSFER (lowSeconds);
+}
+
+void ByteSwapDateTime (DateTime& dateTime);