-rw-r--r-- | qmake/include/quuid.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qmake/include/quuid.h b/qmake/include/quuid.h index 591d2f1..664c149 100644 --- a/qmake/include/quuid.h +++ b/qmake/include/quuid.h | |||
@@ -1,152 +1,152 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
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-2001 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. |
9 | ** | 9 | ** |
10 | ** This file is part of the tools module of the Qt GUI Toolkit. | 10 | ** This file is part of the tools module of the Qt GUI Toolkit. |
11 | ** | 11 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 12 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 13 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 14 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 15 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 16 | ** This file may be distributed and/or modified under the terms of the |
17 | ** GNU General Public License version 2 as published by the Free Software | 17 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 18 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 19 | ** packaging of this file. |
20 | ** | 20 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition |
22 | ** licenses may use this file in accordance with the Qt Commercial License | 22 | ** licenses may use this file in accordance with the Qt Commercial License |
23 | ** Agreement provided with the Software. | 23 | ** Agreement provided with the Software. |
24 | ** | 24 | ** |
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
27 | ** | 27 | ** |
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
29 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
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 |
49 | #define GUID_DEFINED | 49 | #define GUID_DEFINED |
50 | typedef struct _GUID | 50 | typedef struct _GUID |
51 | { | 51 | { |
52 | ulong Data1; | 52 | ulong Data1; |
53 | ushort Data2; | 53 | ushort Data2; |
54 | ushort Data3; | 54 | ushort Data3; |
55 | uchar Data4[ 8 ]; | 55 | uchar Data4[ 8 ]; |
56 | } GUID; | 56 | } GUID, *REFGUID, *LPGUID; |
57 | #endif | 57 | #endif |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | struct Q_EXPORT QUuid | 60 | struct Q_EXPORT QUuid |
61 | { | 61 | { |
62 | QUuid() | 62 | QUuid() |
63 | { | 63 | { |
64 | memset( this, 0, sizeof(QUuid) ); | 64 | memset( this, 0, sizeof(QUuid) ); |
65 | } | 65 | } |
66 | QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) | 66 | QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) |
67 | { | 67 | { |
68 | data1 = l; | 68 | data1 = l; |
69 | data2 = w1; | 69 | data2 = w1; |
70 | data3 = w2; | 70 | data3 = w2; |
71 | data4[0] = b1; | 71 | data4[0] = b1; |
72 | data4[1] = b2; | 72 | data4[1] = b2; |
73 | data4[2] = b3; | 73 | data4[2] = b3; |
74 | data4[3] = b4; | 74 | data4[3] = b4; |
75 | data4[4] = b5; | 75 | data4[4] = b5; |
76 | data4[5] = b6; | 76 | data4[5] = b6; |
77 | data4[6] = b7; | 77 | data4[6] = b7; |
78 | data4[7] = b8; | 78 | data4[7] = b8; |
79 | } | 79 | } |
80 | QUuid( const QUuid &uuid ) | 80 | QUuid( const QUuid &uuid ) |
81 | { | 81 | { |
82 | memcpy( this, &uuid, sizeof(QUuid) ); | 82 | memcpy( this, &uuid, sizeof(QUuid) ); |
83 | } | 83 | } |
84 | #ifndef QT_NO_QUUID_STRING | 84 | #ifndef QT_NO_QUUID_STRING |
85 | QUuid( const QString & ); | 85 | QUuid( const QString & ); |
86 | QUuid( const char * ); | 86 | QUuid( const char * ); |
87 | QString toString() const; | 87 | QString toString() const; |
88 | operator QString() const { return toString(); } | 88 | operator QString() const { return toString(); } |
89 | #endif | 89 | #endif |
90 | bool isNull() const; | 90 | bool isNull() const; |
91 | 91 | ||
92 | QUuid &operator=(const QUuid &orig ) | 92 | QUuid &operator=(const QUuid &orig ) |
93 | { | 93 | { |
94 | memcpy( this, &orig, sizeof(QUuid) ); | 94 | memcpy( this, &orig, sizeof(QUuid) ); |
95 | return *this; | 95 | return *this; |
96 | } | 96 | } |
97 | 97 | ||
98 | bool operator==(const QUuid &orig ) const | 98 | bool operator==(const QUuid &orig ) const |
99 | { | 99 | { |
100 | uint i; | 100 | uint i; |
101 | if ( data1 != orig.data1 || data2 != orig.data2 || | 101 | if ( data1 != orig.data1 || data2 != orig.data2 || |
102 | data3 != orig.data3 ) | 102 | data3 != orig.data3 ) |
103 | return FALSE; | 103 | return FALSE; |
104 | 104 | ||
105 | for( i = 0; i < 8; i++ ) | 105 | for( i = 0; i < 8; i++ ) |
106 | if ( data4[i] != orig.data4[i] ) | 106 | if ( data4[i] != orig.data4[i] ) |
107 | return FALSE; | 107 | return FALSE; |
108 | 108 | ||
109 | return TRUE; | 109 | return TRUE; |
110 | } | 110 | } |
111 | 111 | ||
112 | bool operator!=(const QUuid &orig ) const | 112 | bool operator!=(const QUuid &orig ) const |
113 | { | 113 | { |
114 | return !( *this == orig ); | 114 | return !( *this == orig ); |
115 | } | 115 | } |
116 | 116 | ||
117 | #if defined(Q_OS_WIN32) | 117 | #if defined(Q_OS_WIN32) |
118 | // On Windows we have a type GUID that is used by the platform API, so we | 118 | // 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. | 119 | // provide convenience operators to cast from and to this type. |
120 | QUuid( const GUID &guid ) | 120 | QUuid( const GUID &guid ) |
121 | { | 121 | { |
122 | memcpy( this, &guid, sizeof(GUID) ); | 122 | memcpy( this, &guid, sizeof(GUID) ); |
123 | } | 123 | } |
124 | 124 | ||
125 | QUuid &operator=(const GUID &orig ) | 125 | QUuid &operator=(const GUID &orig ) |
126 | { | 126 | { |
127 | memcpy( this, &orig, sizeof(QUuid) ); | 127 | memcpy( this, &orig, sizeof(QUuid) ); |
128 | return *this; | 128 | return *this; |
129 | } | 129 | } |
130 | 130 | ||
131 | operator GUID() const | 131 | operator GUID() const |
132 | { | 132 | { |
133 | GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; | 133 | GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; |
134 | return guid; | 134 | return guid; |
135 | } | 135 | } |
136 | 136 | ||
137 | bool operator==( const GUID &guid ) const | 137 | bool operator==( const GUID &guid ) const |
138 | { | 138 | { |
139 | uint i; | 139 | uint i; |
140 | if ( data1 != guid.Data1 || data2 != guid.Data2 || | 140 | if ( data1 != guid.Data1 || data2 != guid.Data2 || |
141 | data3 != guid.Data3 ) | 141 | data3 != guid.Data3 ) |
142 | return FALSE; | 142 | return FALSE; |
143 | 143 | ||
144 | for( i = 0; i < 8; i++ ) | 144 | for( i = 0; i < 8; i++ ) |
145 | if ( data4[i] != guid.Data4[i] ) | 145 | if ( data4[i] != guid.Data4[i] ) |
146 | return FALSE; | 146 | return FALSE; |
147 | 147 | ||
148 | return TRUE; | 148 | return TRUE; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool operator!=( const GUID &guid ) const | 151 | bool operator!=( const GUID &guid ) const |
152 | { | 152 | { |