ActiveLib
Loading...
Searching...
No Matches
GuidValue.h
1
6#ifndef ACTIVE_SETTING_GUID_VALUE
7#define ACTIVE_SETTING_GUID_VALUE
8
9#include "Active/Setting/Values/ValueBase.h"
10#include "Active/Serialise/XML/Item/XMLDateTime.h"
11
12namespace active::setting {
13
16
17 // MARK: - Operators
18
24 template<> inline
26 utility::Guid temp{val};
27 if (temp)
28 data = temp;
29 else
30 status = bad;
31 return *this;
32 }
33
34 // MARK: - Conversion operators
35
40 template<> inline
41 GuidValue::operator bool() const { return data; }
46 template<> inline
47 GuidValue::operator utility::String() const { return data; }
52 template<> inline
53 GuidValue::operator utility::Guid() const { return data; }
54
55 // MARK: - Functions (const)
56
61 template<> inline
62 bool GuidValue::isNull() const { return !data; }
67 template<> inline
68 Value::Type GuidValue::getType() const { return idType; };
69
70}
71
72#endif //ACTIVE_SETTING_GUID_VALUE
Definition ValueBase.h:21
virtual bool isNull() const override
Definition ValueBase.h:193
virtual Value & operator=(const Value &val) override
Definition ValueBase.h:85
T data
The value data.
Definition ValueBase.h:58
virtual Type getType() const override
Definition ValueBase.h:198
Definition Value.h:31
Type
Supported value types (broad groups, e.g. int32_t and int64_t are both intType)
Definition Value.h:51
Status status
The value status.
Definition Value.h:100
Definition Guid.h:16
Definition Transportable.h:13