diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2020-02-20 21:22:03 +0100 | 
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-03-01 21:17:26 +0100 | 
| commit | 751cdc6c0235a0623ed980b24b71acb85e94dacf (patch) | |
| tree | fb0b82046f802060c713cc707b5a2f44b284462f /include | |
| parent | 0e9e9c4d233a331e10dfb2db889fe437d0911ba2 (diff) | |
UUID record item type
Diffstat (limited to 'include')
| -rw-r--r-- | include/erebos/storage.h | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 5812783..0859dc8 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -9,6 +9,8 @@  #include <variant>  #include <vector> +#include <uuid/uuid.h> +  namespace erebos {  class Storage; @@ -154,6 +156,17 @@ protected:  	Ref(const std::shared_ptr<const Priv> p): PartialRef(p) {}  }; +struct UUID +{ +	explicit UUID(std::string); +	explicit operator std::string() const; + +	bool operator==(const UUID &) const; +	bool operator!=(const UUID &) const; + +	uuid_t uuid; +}; +  template<class S>  class RecordT  { @@ -171,6 +184,7 @@ public:  			int,  			std::string,  			std::vector<uint8_t>, +			UUID,  			typename S::Ref,  			UnknownType> Variant; @@ -190,6 +204,7 @@ public:  		std::optional<int> asInteger() const;  		std::optional<std::string> asText() const;  		std::optional<std::vector<uint8_t>> asBinary() const; +		std::optional<UUID> asUUID() const;  		std::optional<typename S::Ref> asRef() const;  		std::optional<UnknownType> asUnknown() const; |