src/uuid.cpp

Mon, 23 Sep 2019 14:06:36 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 23 Sep 2019 14:06:36 +0300
changeset 4
68988ebc2a68
parent 2
2bdc3ac5e77c
permissions
-rw-r--r--

added regular expressions for the parser

#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