src/uuid.cpp

Sat, 24 Aug 2019 14:44:42 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 24 Aug 2019 14:44:42 +0300
changeset 2
2bdc3ac5e77c
permissions
-rw-r--r--

things

#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