struct final
UIDis an object holding a Unique IDentifier (UID)
UID generates a unique ID, either through a random number generator, or by using OS provided methods. It is immutable once created.
static variables
static member functions
constructors, destructors, conversion operators
member-functions
Function documentation
static UID psl:: UID:: from_string(const psl:: string8_t& key)
Brief
tries to convert from the given string based representation to a valid UID.
Details
when sending a string of the form "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" or "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" to this method, it will parse it and will return a valid UID instance. Otherwise it will return UID::
Parameters | |
---|---|
key in | a string in the valid format to convert to UID. |
Returns | either a valid UID based on the key, or UID:: |
static bool psl:: UID:: valid(const psl:: string8_t& key) noexcept
Brief
checks the given string if it's in a valid UID format.
Parameters | |
---|---|
key in | the string to be checked. |
Returns | true if the given key is convertible to a UID instance. |
psl:: UID:: operator bool() const
Brief
checks if the held UID is valid.
Returns | true in case the held UID is valid. |
---|
const psl:: string8_t psl:: UID:: to_string() const
Brief
creates a string based representation of the owned UID.
Details
creates a string based representation of the owned UID of the form "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
Returns | a UTF-8 string based representation of the owned UID. |
---|
void psl:: UID:: invalidate()
Brief
invalidates the current UID.
Details
If for some reason you want to invalidate this object as being a valid UID, then calling this method will set the internal UID to be equivalent to UID::
Variable documentation
static UID psl:: UID:: invalid_uid
a global instance that signifies the invalid_uid used by the current runtime.