12#include "private/qtools_p.h"
23template <
class Integral>
28 const char *
p =
reinterpret_cast<const char *
>(&
value);
30 for (
uint i = 0;
i <
sizeof(Integral); ++
i,
dst += 2) {
36template <
class Integral>
41 for (
uint i = 0;
i <
sizeof(Integral) * 2; ++
i) {
66 for (
int i = 0;
i < 2;
i++)
70 for (
int i = 2;
i < 8;
i++)
112 return QUuid(
d1,
d2, d3, d4[0], d4[1], d4[2], d4[3], d4[4], d4[5], d4[6], d4[7]);
122 hash.addData(
ns.toRfc4122());
123 hash.addData(baseData);
131 result.data3 |= (version << 12);
450 *
dst++ =
ch.toLatin1();
519#ifndef QT_BOOTSTRAPPED
549 if (bytes.isEmpty() || bytes.size() != 16)
551 return fromBytes(bytes.data());
693#ifndef QT_NO_DATASTREAM
702 bytes =
id.toRfc4122();
718 for (
int i = 0;
i < 8; ++
i) {
719 *(
data) =
id.data4[
i];
724 if (
s.writeRawData(bytes.
data(), 16) != 16) {
736 std::array<char, 16> bytes;
737 if (
s.readRawData(bytes.data(), 16) != 16) {
745 const uchar *
data =
reinterpret_cast<const uchar *
>(bytes.data());
747 id.data1 = qFromLittleEndian<quint32>(
data);
749 id.data2 = qFromLittleEndian<quint16>(
data);
751 id.data3 = qFromLittleEndian<quint16>(
data);
754 for (
int i = 0;
i < 8; ++
i) {
755 id.data4[
i] = *(
data);
822 if ((
data4[0] & 0x80) == 0x00)
return NCS;
823 else if ((
data4[0] & 0xC0) == 0x80)
return DCE;
866#define ISLESS(f1, f2) if (f1!=f2) return (f1<f2);
870 for (
int n = 0;
n < 8;
n++) {
890 return other < *
this;
951 enum { AmountToRead = 4 };
975#ifndef QT_NO_DEBUG_STREAM
983 dbg.nospace() <<
"QUuid(" <<
id.toString() <<
')';
995 return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
996 ^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
997 ^ ((uuid.data4[4] << 24) | (uuid.data4[5] << 16) | (uuid.data4[6] << 8) | uuid.data4[7])
QByteArray toByteArray() const
constexpr void truncate(qsizetype n)
constexpr qsizetype size() const noexcept
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
\inmodule QtCore\reentrant
void setStatus(Status status)
Sets the status of the data stream to the status given.
static Q_DECL_CONST_FUNCTION QRandomGenerator * system()
\threadsafe
void fillRange(UInt *buffer, qsizetype count)
Generates count 32- or 64-bit quantities (depending on the type UInt) and stores them in the buffer p...
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void truncate(qsizetype pos)
Truncates the string at the given position index.
qsizetype size() const
Returns the number of characters in this string.
QChar * data()
Returns a pointer to the data stored in the QString.
Version
This enum defines the values used in the \l{Version field} {version field} of the UUID.
size_t qHash(const QUuid &uuid, size_t seed) noexcept
static QUuid createUuid()
On any platform other than Windows, this function returns a new UUID with variant QUuid::DCE and vers...
Variant
This enum defines the values used in the \l{Variant field} {variant field} of the UUID.
QString toString(StringFormat mode=WithBraces) const
bool operator>(const QUuid &other) const noexcept
Returns true if this QUuid has the same \l{Variant field} {variant field} as the other QUuid and is l...
static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData)
QUuid::Variant variant() const noexcept
Returns the value in the \l{Variant field} {variant field} of the UUID.
Id128Bytes toBytes(QSysInfo::Endian order=QSysInfo::BigEndian) const noexcept
static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData)
static QUuid fromRfc4122(QByteArrayView) noexcept
Creates a QUuid object from the binary representation of the UUID, as specified by RFC 4122 section 4...
QByteArray toByteArray(StringFormat mode=WithBraces) const
static QUuid fromString(QAnyStringView string) noexcept
bool isNull() const noexcept
Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false...
QDataStream & operator>>(QDataStream &s, QUuid &id)
Reads a UUID from the stream s into id.
QUuid::Version version() const noexcept
Returns the \l{Version field} {version field} of the UUID, if the UUID's \l{Variant field} {variant f...
bool operator<(const QUuid &other) const noexcept
Returns true if this QUuid has the same \l{Variant field} {variant field} as the other QUuid and is l...
QByteArray toRfc4122() const
Returns the binary representation of this QUuid.
QDebug operator<<(QDebug dbg, const QUuid &id)
Writes the UUID id to the output stream for debugging information dbg.
QDataStream & operator<<(QDataStream &s, const QUuid &id)
Writes the UUID id to the data stream s.
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
constexpr char toHexLower(char32_t value) noexcept
constexpr int fromHex(char32_t c) noexcept
constexpr Initialization Uninitialized
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr T qToBigEndian(T source)
constexpr T qToLittleEndian(T source)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
#define QT_BEGIN_INCLUDE_NAMESPACE
#define QT_END_INCLUDE_NAMESPACE
bool _q_fromHex(const char *&src, Integral &value)
static char * _q_uuidToHex(const QUuid &uuid, char *dst, QUuid::StringFormat mode=QUuid::WithBraces)
void _q_toHex(char *&dst, Integral value)
static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCryptographicHash::Algorithm algorithm, int version)
static Q_NEVER_INLINE QUuid _q_uuidFromHex(const char *src)
static QUuid uuidFromString(QStringView text) noexcept