quuid.sip 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // quuid.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtCore Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QUuid
  22. {
  23. %TypeHeaderCode
  24. #include <quuid.h>
  25. %End
  26. public:
  27. enum Variant
  28. {
  29. VarUnknown,
  30. NCS,
  31. DCE,
  32. Microsoft,
  33. Reserved,
  34. };
  35. enum Version
  36. {
  37. VerUnknown,
  38. Time,
  39. EmbeddedPOSIX,
  40. Md5,
  41. Name,
  42. Random,
  43. Sha1,
  44. %If (Qt_6_9_0 -)
  45. UnixEpoch,
  46. %End
  47. };
  48. enum StringFormat
  49. {
  50. WithBraces,
  51. WithoutBraces,
  52. Id128,
  53. };
  54. QUuid();
  55. %If (Qt_6_6_0 -)
  56. QUuid(QUuid::Id128Bytes id128, QSysInfo::Endian order = QSysInfo::BigEndian);
  57. %End
  58. QUuid(uint l, ushort w1, ushort w2, uchar b1 /PyInt/, uchar b2 /PyInt/, uchar b3 /PyInt/, uchar b4 /PyInt/, uchar b5 /PyInt/, uchar b6 /PyInt/, uchar b7 /PyInt/, uchar b8 /PyInt/);
  59. %If (Qt_6_4_0 -)
  60. explicit QUuid(QAnyStringView string);
  61. %End
  62. %If (- Qt_6_4_0)
  63. explicit QUuid(const QString &);
  64. %End
  65. %If (- Qt_6_4_0)
  66. explicit QUuid(const QByteArray &);
  67. %End
  68. Py_hash_t __hash__() const;
  69. %MethodCode
  70. sipRes = qHash(*sipCpp);
  71. %End
  72. SIP_PYOBJECT __repr__() const /TypeHint="str"/;
  73. %MethodCode
  74. PyObject *uni = qpycore_PyObject_FromQString(sipCpp->toString());
  75. if (uni)
  76. {
  77. sipRes = PyUnicode_FromFormat("PyQt6.QtCore.QUuid(%R)", uni);
  78. Py_DECREF(uni);
  79. }
  80. %End
  81. QString toString(QUuid::StringFormat mode = QUuid::WithBraces) const;
  82. bool isNull() const;
  83. %If (- Qt_6_8_0)
  84. bool operator==(const QUuid &orig) const;
  85. %End
  86. %If (- Qt_6_8_0)
  87. bool operator!=(const QUuid &orig) const;
  88. %End
  89. %If (- Qt_6_8_0)
  90. bool operator<(const QUuid &other) const;
  91. %End
  92. %If (- Qt_6_8_0)
  93. bool operator>(const QUuid &other) const;
  94. %End
  95. static QUuid createUuid();
  96. %If (Qt_6_8_0 -)
  97. static QUuid createUuidV3(QUuid ns, QByteArrayView baseData);
  98. %End
  99. %If (- Qt_6_8_0)
  100. static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData);
  101. %End
  102. static QUuid createUuidV3(const QUuid &ns, const QString &baseData);
  103. %If (Qt_6_8_0 -)
  104. static QUuid createUuidV5(QUuid ns, QByteArrayView baseData);
  105. %End
  106. %If (- Qt_6_8_0)
  107. static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData);
  108. %End
  109. static QUuid createUuidV5(const QUuid &ns, const QString &baseData);
  110. %If (Qt_6_9_0 -)
  111. static QUuid createUuidV7();
  112. %End
  113. QUuid::Variant variant() const;
  114. QUuid::Version version() const;
  115. QByteArray toByteArray(QUuid::StringFormat mode = QUuid::WithBraces) const;
  116. QByteArray toRfc4122() const;
  117. %If (Qt_6_3_0 -)
  118. static QUuid fromRfc4122(QByteArrayView);
  119. %End
  120. %If (- Qt_6_3_0)
  121. static QUuid fromRfc4122(const QByteArray &);
  122. %End
  123. %If (Qt_6_4_0 -)
  124. static QUuid fromString(QAnyStringView string);
  125. %End
  126. %If (- Qt_6_4_0)
  127. static QUuid fromString(QStringView string);
  128. %End
  129. %If (Qt_6_6_0 -)
  130. struct Id128Bytes
  131. {
  132. %TypeHeaderCode
  133. #include <quuid.h>
  134. %End
  135. };
  136. %End
  137. };
  138. QDataStream &operator<<(QDataStream &, const QUuid & /Constrained/) /ReleaseGIL/;
  139. QDataStream &operator>>(QDataStream &, QUuid & /Constrained/) /ReleaseGIL/;
  140. bool operator<=(const QUuid &lhs, const QUuid &rhs);
  141. bool operator>=(const QUuid &lhs, const QUuid &rhs);
  142. %If (Qt_6_8_0 -)
  143. bool operator>(const QUuid &lhs, const QUuid &rhs);
  144. %End
  145. %If (Qt_6_8_0 -)
  146. bool operator<(const QUuid &lhs, const QUuid &rhs);
  147. %End
  148. %If (Qt_6_8_0 -)
  149. bool operator!=(const QUuid &lhs, const QUuid &rhs);
  150. %End
  151. %If (Qt_6_8_0 -)
  152. bool operator==(const QUuid &lhs, const QUuid &rhs);
  153. %End