src/uuid.cpp

changeset 2
2bdc3ac5e77c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uuid.cpp	Sat Aug 24 14:44:42 2019 +0300
@@ -0,0 +1,22 @@
+#include "uuid.h"
+#include <QIODevice>
+
+void uuidToString(const Uuid &uuid, QTextStream &stream)
+{
+    stream << "0x";
+    stream << QString::number(uuid.a, 16);
+    stream << QString::number(uuid.b, 16);
+}
+
+void incrementUuid(Uuid &uuid)
+{
+    if (uuid.b == std::numeric_limits<decltype(uuid.b)>::max())
+    {
+        uuid.a += 1;
+        uuid.b = 0;
+    }
+    else
+    {
+        uuid.b += 1;
+    }
+}

mercurial