aboutsummaryrefslogtreecommitdiff
path: root/source/Uid.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-22 23:05:03 -0700
committerrtk0c <[email protected]>2022-05-22 23:05:03 -0700
commit123f741e3f5374b93ac39887b62bfa0d66762ae2 (patch)
treecedbc4b2dd87e2caadfde48a0c12a0336672bdd3 /source/Uid.hpp
parentc568f0a8c9f0aef00c770b494ee1ff3a89ab48de (diff)
Changeset: 36 Add basic machinery for levels (no saving/loading yet)
Diffstat (limited to 'source/Uid.hpp')
-rw-r--r--source/Uid.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/Uid.hpp b/source/Uid.hpp
index a076533..f58129c 100644
--- a/source/Uid.hpp
+++ b/source/Uid.hpp
@@ -3,8 +3,15 @@
#include "Utils.hpp"
#include <rapidjson/fwd.h>
-#include <cstdint>
+#include <cinttypes>
#include <functional>
+#include <string>
+#include <string_view>
+
+#define BRUSSEL_Uid_SCAN_STR "%" PRIx64 "-%" PRIx64
+#define BRUSSEL_Uid_SCAN_EXPAND(uid) &((uid).upper), &((uid).upper)
+#define BRUSSEL_Uid_FORMAT_STR "%016" PRIx64 "-%016" PRIx64
+#define BRUSSEL_Uid_FORMAT_EXPAND(uid) (uid).upper, (uid).lower
struct Uid {
uint64_t upper = 0;
@@ -14,6 +21,9 @@ struct Uid {
bool IsNull() const;
+ void ReadString(std::string_view str);
+ std::string WriteString();
+
void Read(const rapidjson::Value& value);
void WriteInto(rapidjson::Value& value, rapidjson::Document& root);
rapidjson::Value Write(rapidjson::Document& root);