From c00945ec1e5804003fb47798e86cd0c737a14d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 6 Jun 2020 14:47:45 +0200 Subject: UUID: random generation and format checking functions --- include/erebos/uuid.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/erebos/uuid.h') diff --git a/include/erebos/uuid.h b/include/erebos/uuid.h index 9b615f8..e67677a 100644 --- a/include/erebos/uuid.h +++ b/include/erebos/uuid.h @@ -1,15 +1,22 @@ #pragma once #include +#include #include namespace erebos { struct UUID { - explicit UUID(std::string); + UUID(): uuid({}) {} + explicit UUID(const std::string &); explicit operator std::string() const; + static std::optional fromString(const std::string &); + static bool fromString(const std::string &, UUID &); + + static UUID generate(); + bool operator==(const UUID &) const; bool operator!=(const UUID &) const; -- cgit v1.2.3