summaryrefslogtreecommitdiff
path: root/src/common/uuid.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-09-22 17:52:37 -0400
committerLioncash <mathew1800@gmail.com>2021-09-22 17:59:00 -0400
commit40314cc58646e9e91e961e0d82b7d1b53bd839a0 (patch)
tree17ec58af41507fc0edff29325b528ac4029d599b /src/common/uuid.h
parent7b22d61fb1b18d20bf16d940b0002d3668697166 (diff)
common/uuid: Add validity checking functions to interface
Given we have a function to invalidate, we should also have ones to query the validity. Also makes the code more straightforward to read.
Diffstat (limited to 'src/common/uuid.h')
-rw-r--r--src/common/uuid.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h
index 2353179d8..8ea01f8da 100644
--- a/src/common/uuid.h
+++ b/src/common/uuid.h
@@ -58,6 +58,13 @@ struct UUID {
uuid = INVALID_UUID;
}
+ [[nodiscard]] constexpr bool IsInvalid() const {
+ return uuid == INVALID_UUID;
+ }
+ [[nodiscard]] constexpr bool IsValid() const {
+ return !IsInvalid();
+ }
+
// TODO(ogniK): Properly generate a Nintendo ID
[[nodiscard]] constexpr u64 GetNintendoID() const {
return uuid[0];