1// quuid.sip generated by MetaSIP
2//
3// This file is part of the QtCore Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
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
22
23class QUuid
24{
25%TypeHeaderCode
26#include <quuid.h>
27%End
28
29public:
30    enum Variant
31    {
32        VarUnknown,
33        NCS,
34        DCE,
35        Microsoft,
36        Reserved,
37    };
38
39    enum Version
40    {
41        VerUnknown,
42        Time,
43        EmbeddedPOSIX,
44        Md5,
45        Name,
46        Random,
47        Sha1,
48    };
49
50%If (Qt_5_11_0 -)
51
52    enum StringFormat
53    {
54        WithBraces,
55        WithoutBraces,
56        Id128,
57    };
58
59%End
60    QUuid();
61    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/);
62    QUuid(const QString &);
63    QUuid(const QByteArray &);
64    long __hash__() const;
65%MethodCode
66        sipRes = qHash(*sipCpp);
67%End
68
69    SIP_PYOBJECT __repr__() const /TypeHint="str"/;
70%MethodCode
71        PyObject *uni = qpycore_PyObject_FromQString(sipCpp->toString());
72
73        if (uni)
74        {
75        #if PY_MAJOR_VERSION >= 3
76            sipRes = PyUnicode_FromFormat("PyQt5.QtCore.QUuid(%R)", uni);
77        #else
78            sipRes = PyString_FromFormat("PyQt5.QtCore.QUuid(");
79            PyString_ConcatAndDel(&sipRes, PyObject_Repr(uni));
80            PyString_ConcatAndDel(&sipRes, PyString_FromString(")"));
81        #endif
82
83            Py_DECREF(uni);
84        }
85%End
86
87    QString toString() const;
88%If (Qt_5_11_0 -)
89    QString toString(QUuid::StringFormat mode) const;
90%End
91    bool isNull() const;
92    bool operator==(const QUuid &orig) const;
93    bool operator!=(const QUuid &orig) const;
94    bool operator<(const QUuid &other) const;
95    bool operator>(const QUuid &other) const;
96    static QUuid createUuid();
97    static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData);
98    static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData);
99    static QUuid createUuidV3(const QUuid &ns, const QString &baseData);
100    static QUuid createUuidV5(const QUuid &ns, const QString &baseData);
101    QUuid::Variant variant() const;
102    QUuid::Version version() const;
103    QByteArray toByteArray() const;
104%If (Qt_5_11_0 -)
105    QByteArray toByteArray(QUuid::StringFormat mode) const;
106%End
107    QByteArray toRfc4122() const;
108    static QUuid fromRfc4122(const QByteArray &);
109};
110
111QDataStream &operator<<(QDataStream &, const QUuid & /Constrained/) /ReleaseGIL/;
112QDataStream &operator>>(QDataStream &, QUuid & /Constrained/) /ReleaseGIL/;
113%If (Qt_5_5_0 -)
114bool operator<=(const QUuid &lhs, const QUuid &rhs);
115%End
116%If (Qt_5_5_0 -)
117bool operator>=(const QUuid &lhs, const QUuid &rhs);
118%End
119