7#include <QtCore/qendian.h>
8#include <QtCore/qstring.h>
10#if defined(Q_OS_WIN) || defined(Q_QDOC)
19} GUID, *REFGUID, *LPGUID;
23#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
63#if defined(__SIZEOF_INT128__)
66 unsigned __int128 data128[1];
68#elif defined(QT_SUPPORTS_INT128)
69# error "struct QUuid::Id128Bytes should not depend on QT_SUPPORTS_INT128 for ABI reasons."
70# error "Adjust the declaration of the `data128` member above so it is always defined if it's " \
71 "supported by the current compiler/architecture in any configuration."
90 constexpr QUuid() noexcept : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
94 : data1(l), data2(
w1), data3(
w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {}
100#if QT_CORE_REMOVED_SINCE(6, 3)
104 explicit QUuid(
const char *);
113#if QT_CORE_REMOVED_SINCE(6, 3)
118 bool isNull() const noexcept;
120#ifdef QT_SUPPORTS_INT128
127 if (data1 != orig.data1 || data2 != orig.data2 ||
132 if (data4[
i] != orig.data4[
i])
140 return !(*
this == orig);
146#if defined(Q_OS_WIN) || defined(Q_QDOC)
149 constexpr QUuid(
const GUID &guid) noexcept
150 : data1(guid.Data1), data2(guid.Data2), data3(guid.Data3),
151 data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
152 guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]} {}
154 constexpr QUuid &operator=(
const GUID &guid)
noexcept
160 constexpr operator GUID() const noexcept
162 GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } };
166 constexpr bool operator==(
const GUID &guid)
const noexcept
168 return *
this ==
QUuid(guid);
171 constexpr bool operator!=(
const GUID &guid)
const noexcept
173 return !(*
this == guid);
176 static QUuid createUuid();
177#ifndef QT_BOOTSTRAPPED
181#ifndef QT_BOOTSTRAPPED
196#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
197 static QUuid fromCFUUID(CFUUIDRef uuid);
199 static
QUuid fromNSUUID(const NSUUID *uuid);
211#ifndef QT_NO_DATASTREAM
216#ifndef QT_NO_DEBUG_STREAM
226 data1 = qFromBigEndian<quint32>(&uuid.data[0]);
227 data2 = qFromBigEndian<quint16>(&uuid.data[4]);
228 data3 = qFromBigEndian<quint16>(&uuid.data[6]);
229 memcpy(data4, &uuid.data[8],
sizeof(data4));
238 memcpy(&
result.data[8], data4,
sizeof(data4));
251#ifdef QT_SUPPORTS_INT128
257 result.data2 = qFromBigEndian<quint16>(
ushort(uuid >> 32));
258 result.data3 = qFromBigEndian<quint16>(
ushort(uuid >> 48));
259 for (
int i = 0;
i < 8; ++
i)
262 result.data1 = qFromLittleEndian<quint32>(
uint(uuid >> 96));
263 result.data2 = qFromLittleEndian<quint16>(
ushort(uuid >> 80));
264 result.data3 = qFromLittleEndian<quint16>(
ushort(uuid >> 64));
265 for (
int i = 0;
i < 8; ++
i)
275 for (
int i = 0;
i < 8; ++
i)
280 result |= qToBigEndian<quint32>(data1);
282 result = qToLittleEndian<quint32>(data1);
287 for (
int i = 0;
i < 8; ++
i)
295{
return !(rhs < lhs); }
297{
return !(lhs < rhs); }
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Endian
\value BigEndian Big-endian byte order (also called Network byte order) \value LittleEndian Little-en...
static QUuid createUuidV3(const QUuid &ns, const QString &baseData)
constexpr bool operator!=(const QUuid &orig) const noexcept
Returns true if this QUuid and the other QUuid are different; otherwise returns false.
Version
This enum defines the values used in the \l{Version field} {version field} of the UUID.
static QUuid fromBytes(const void *bytes, QSysInfo::Endian order=QSysInfo::BigEndian)
Variant
This enum defines the values used in the \l{Variant field} {variant field} of the UUID.
constexpr QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept
Creates a UUID with the value specified by the parameters, l, w1, w2, b1, b2, b3, b4,...
QUuid(QAnyStringView string) noexcept
Creates a QUuid object from the string text, which must be formatted as five hex fields separated by ...
static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData)
Id128Bytes toBytes(QSysInfo::Endian order=QSysInfo::BigEndian) const noexcept
static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData)
static QUuid createUuidV5(const QUuid &ns, const QString &baseData)
constexpr bool operator==(const QUuid &orig) const noexcept
Returns true if this QUuid and the other QUuid are identical; otherwise returns false.
constexpr QUuid() noexcept
Creates the null UUID.
std::list< QString >::iterator Name
Combined button and popup list for selecting options.
void toByteArray(QByteArray &)
#define Q_DECL_NS_RETURNS_AUTORELEASED
#define Q_DECL_CF_RETURNS_RETAINED
#define QT_WARNING_DISABLE_GCC(text)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
#define Q_FORWARD_DECLARE_CF_TYPE(type)
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
constexpr T qbswap(T source)
constexpr T qFromLittleEndian(T source)
constexpr T qToBigEndian(T source)
constexpr T qFromBigEndian(T source)
constexpr T qToLittleEndian(T source)
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
GLfixed GLfixed GLint GLint order
bool operator>(const QPoint &a, const QPoint &b)
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QUuid &)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QUuid &)
bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
Q_CORE_EXPORT size_t qHash(const QUuid &uuid, size_t seed=0) noexcept
bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
char * toString(const MyType &t)
[31]
friend constexpr Id128Bytes qbswap(Id128Bytes b) noexcept