From 9076a13c78cf64a6afafe98817aed31feda568b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 1 Mar 2020 21:54:33 +0100 Subject: Date and time record item type --- include/erebos/storage.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/erebos') diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 0859dc8..b6595b6 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -156,6 +157,18 @@ protected: Ref(const std::shared_ptr p): PartialRef(p) {} }; +struct ZonedTime +{ + explicit ZonedTime(std::string); + ZonedTime(std::chrono::system_clock::time_point t): time(t), zone(0) {} + explicit operator std::string() const; + + static ZonedTime now(); + + std::chrono::system_clock::time_point time; + std::chrono::minutes zone; // zone offset +}; + struct UUID { explicit UUID(std::string); @@ -184,6 +197,7 @@ public: int, std::string, std::vector, + ZonedTime, UUID, typename S::Ref, UnknownType> Variant; @@ -204,6 +218,7 @@ public: std::optional asInteger() const; std::optional asText() const; std::optional> asBinary() const; + std::optional asDate() const; std::optional asUUID() const; std::optional asRef() const; std::optional asUnknown() const; -- cgit v1.2.3