diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index b927263c..4ed36031 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -175,6 +175,7 @@ extern const EbmlSemanticContext Context_EbmlGlobal; #define DEFINE_SEMANTIC_ITEM(m,u,c) EbmlSemantic(m, u, EBML_INFO(c)), #define DEFINE_SEMANTIC_ITEM_UINT(m,u,d,c) EbmlSemantic(m, u, static_cast(d), EBML_INFO(c)), #define DEFINE_SEMANTIC_ITEM_SINT(m,u,d,c) EbmlSemantic(m, u, static_cast(d), EBML_INFO(c)), +#define DEFINE_SEMANTIC_ITEM_DATE(m,u,d,c) EbmlSemantic(m, u, static_cast(d,true), EBML_INFO(c)), #define DEFINE_SEMANTIC_ITEM_DOUBLE(m,u,d,c) EbmlSemantic(m, u, static_cast(d), EBML_INFO(c)), #define DEFINE_SEMANTIC_ITEM_STRING(m,u,d,c) EbmlSemantic(m, u, static_cast(d), EBML_INFO(c)), #define DEFINE_SEMANTIC_ITEM_UNISTRING(m,u,d,c) EbmlSemantic(m, u, static_cast(d), EBML_INFO(c)), @@ -355,6 +356,7 @@ class EBML_DLL_API EbmlSemantic { NO_DEFAULT, UINTEGER, SINTEGER, + DATE, DOUBLE, STRING, UNISTRING, @@ -371,7 +373,7 @@ class EBML_DLL_API EbmlSemantic { constexpr DefaultValues(void) : u64(0), type(DefaultType::NO_DEFAULT) {} constexpr DefaultValues(const DefaultValues &) = default; constexpr DefaultValues(std::uint64_t u) : u64(u), type(DefaultType::UINTEGER) {} - constexpr DefaultValues(std::int64_t u) : u64(u), type(DefaultType::UINTEGER) {} + constexpr DefaultValues(std::int64_t u, bool date = false) : i64(u), type(date ? DefaultType::UINTEGER : DefaultType::DATE) {} constexpr DefaultValues(double d) : f(d), type(DefaultType::DOUBLE) {} constexpr DefaultValues(const char *d) : s(d), type(DefaultType::STRING) {} constexpr DefaultValues(const wchar_t *d) : ws(d), type(DefaultType::UNISTRING) {}