src/uuid.cpp

Sun, 22 Sep 2019 11:51:41 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 22 Sep 2019 11:51:41 +0300
changeset 3
55a55a9ec2c2
parent 2
2bdc3ac5e77c
permissions
-rw-r--r--

Added lots of code

#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