summaryrefslogtreecommitdiff
path: root/qmake/include/quuid.h
Unidiff
Diffstat (limited to 'qmake/include/quuid.h') (more/less context) (show whitespace changes)
-rw-r--r--qmake/include/quuid.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/qmake/include/quuid.h b/qmake/include/quuid.h
index 664c149..f5d8a86 100644
--- a/qmake/include/quuid.h
+++ b/qmake/include/quuid.h
@@ -1,8 +1,8 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2**
3** 3**
4** Definition of QUuid class 4** Definition of QUuid class
5** 5**
6** Created : 010523 6** Created : 010523
7** 7**
8** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
@@ -36,13 +36,13 @@
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QUUID_H 38#ifndef QUUID_H
39#define QUUID_H 39#define QUUID_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include <qstring.h> 42#include "qstring.h"
43#endif // QT_H 43#endif // QT_H
44 44
45#include <string.h> 45#include <string.h>
46 46
47#if defined(Q_OS_WIN32) 47#if defined(Q_OS_WIN32)
48#ifndef GUID_DEFINED 48#ifndef GUID_DEFINED
@@ -54,14 +54,31 @@ typedef struct _GUID
54 ushort Data3; 54 ushort Data3;
55 uchar Data4[ 8 ]; 55 uchar Data4[ 8 ];
56} GUID, *REFGUID, *LPGUID; 56} GUID, *REFGUID, *LPGUID;
57#endif 57#endif
58#endif 58#endif
59 59
60
60struct Q_EXPORT QUuid 61struct Q_EXPORT QUuid
61{ 62{
63 enum Variant {
64 VarUnknown=-1,
65 NCS = 0, // 0 - -
66 DCE = 2, // 1 0 -
67 Microsoft= 6, // 1 1 0
68 Reserved= 7 // 1 1 1
69 };
70
71 enum Version {
72 VerUnknown=-1,
73 Time = 1, // 0 0 0 1
74 EmbeddedPOSIX= 2, // 0 0 1 0
75 Name = 3, // 0 0 1 1
76 Random = 4 // 0 1 0 0
77 };
78
62 QUuid() 79 QUuid()
63 { 80 {
64 memset( this, 0, sizeof(QUuid) ); 81 memset( this, 0, sizeof(QUuid) );
65 } 82 }
66 QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) 83 QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
67 { 84 {
@@ -111,12 +128,15 @@ struct Q_EXPORT QUuid
111 128
112 bool operator!=(const QUuid &orig ) const 129 bool operator!=(const QUuid &orig ) const
113 { 130 {
114 return !( *this == orig ); 131 return !( *this == orig );
115 } 132 }
116 133
134 bool operator<(const QUuid &other ) const;
135 bool operator>(const QUuid &other ) const;
136
117#if defined(Q_OS_WIN32) 137#if defined(Q_OS_WIN32)
118 // On Windows we have a type GUID that is used by the platform API, so we 138 // On Windows we have a type GUID that is used by the platform API, so we
119 // provide convenience operators to cast from and to this type. 139 // provide convenience operators to cast from and to this type.
120 QUuid( const GUID &guid ) 140 QUuid( const GUID &guid )
121 { 141 {
122 memcpy( this, &guid, sizeof(GUID) ); 142 memcpy( this, &guid, sizeof(GUID) );
@@ -150,12 +170,15 @@ struct Q_EXPORT QUuid
150 170
151 bool operator!=( const GUID &guid ) const 171 bool operator!=( const GUID &guid ) const
152 { 172 {
153 return !( *this == guid ); 173 return !( *this == guid );
154 } 174 }
155#endif 175#endif
176 static QUuid createUuid();
177 QUuid::Variant variant() const;
178 QUuid::Version version() const;
156 179
157 uint data1; 180 uint data1;
158 ushort data2; 181 ushort data2;
159 ushort data3; 182 ushort data3;
160 uchar data4[ 8 ]; 183 uchar data4[ 8 ];
161}; 184};