1QUuid(3qt) QUuid(3qt)
2
3
4
6 QUuid - Defines a Universally Unique Identifier (UUID)
7
9 All the functions in this class are reentrant when Qt is built with
10 thread support.</p>
11
12 #include <quuid.h>
13
14 Public Members
15 enum Variant { VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6,
16 Reserved = 7 }
17 enum Version { VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3,
18 Random = 4 }
19 QUuid ()
20 QUuid ( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3,
21 uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
22 QUuid ( const QUuid & orig )
23 QUuid ( const QString & text )
24 QString toString () const
25 operator QString () const
26 bool isNull () const
27 QUuid & operator= ( const QUuid & uuid )
28 bool operator== ( const QUuid & other ) const
29 bool operator!= ( const QUuid & other ) const
30 bool operator< ( const QUuid & other ) const
31 bool operator> ( const QUuid & other ) const
32 QUuid::Variant variant () const
33 QUuid::Version version () const
34
35 Static Public Members
36 QUuid createUuid ()
37
39 QDataStream & operator<< ( QDataStream & s, const QUuid & id )
40 QDataStream & operator>> ( QDataStream & s, QUuid & id )
41
43 The QUuid class defines a Universally Unique Identifier (UUID).
44
45 For objects or declarations that must be uniquely identified, UUIDs
46 (also known as GUIDs) are widely used in order to assign a fixed and
47 easy to compare value to the object or declaration. The 128-bit value
48 of a UUID is generated by an algorithm that guarantees that the value
49 is unique.
50
51 In Qt, UUIDs are wrapped by the QUuid struct which provides convenience
52 functions for handling UUIDs. Most platforms provide a tool to generate
53 new UUIDs, for example, uuidgen and guidgen.
54
55 UUIDs generated by QUuid, are based on the Random version of the DCE
56 (Distributed Computing Environment) standard.
57
58 UUIDs can be constructed from numeric values or from strings, or using
59 the static createUuid() function. They can be converted to a string
60 with toString(). UUIDs have a variant() and a version(), and null UUIDs
61 return TRUE from isNull().
62
63 Member Type Documentation
65 This enum defines the variant of the UUID, which is the scheme which
66 defines the layout of the 128-bits value.
67
68 QUuid::VarUnknown - Variant is unknown
69
70 QUuid::NCS - Reserved for NCS (Network Computing System) backward
71 compatibility
72
73 QUuid::DCE - Distributed Computing Environment, the scheme used by
74 QUuid
75
76 QUuid::Microsoft - Reserved for Microsoft backward compatibility (GUID)
77
78 QUuid::Reserved - Reserved for future definition
79
81 This enum defines the version of the UUID.
82
83 QUuid::VerUnknown - Version is unknown
84
85 QUuid::Time - Time-based, by using timestamp, clock sequence, and MAC
86 network card address (if available) for the node sections
87
88 QUuid::EmbeddedPOSIX - DCE Security version, with embedded POSIX UUIDs
89
90 QUuid::Name - Name-based, by using values from a name for all sections
91
92 QUuid::Random - Random-based, by using random numbers for all sections
93
96 Creates the null UUID {00000000-0000-0000-0000-000000000000}.
97
99 uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
100 Creates a UUID with the value specified by the parameters, l, w1, w2,
101 b1, b2, b3, b4, b5, b6, b7, b8.
102
103 Example:
104
105 // {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
106 QUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee )
107
109 Creates a copy of the QUuid orig.
110
112 Creates a QUuid object from the string text. The function can only
113 convert a string in the format {HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH}
114 (where 'H' stands for a hex digit). If the conversion fails a null UUID
115 is created.
116
118 Returns a new UUID of DCE variant, and Random type. The UUIDs generated
119 are based on the platform specific pseudo-random generator, which is
120 usually not a cryptographic-quality random number generator. Therefore,
121 a UUID is not guaranteed to be unique cross application instances.
122
123 On Windows, the new UUID is extremely likely to be unique on the same
124 or any other system, networked or not.
125
126 See also variant() and version().
127
129 Returns TRUE if this is the null UUID
130 {00000000-0000-0000-0000-000000000000}; otherwise returns FALSE.
131
133 Returns the string representation of the uuid.
134
135 See also toString().
136
138 Returns TRUE if this QUuid and the other QUuid are different; otherwise
139 returns FALSE.
140
142 Returns TRUE if this QUuid is of the same variant, and
143 lexicographically before the other QUuid; otherwise returns FALSE.
144
145 See also variant().
146
148 Assigns the value of uuid to this QUuid object.
149
151 Returns TRUE if this QUuid and the other QUuid are identical; otherwise
152 returns FALSE.
153
155 Returns TRUE if this QUuid is of the same variant, and
156 lexicographically after the other QUuid; otherwise returns FALSE.
157
158 See also variant().
159
161 QString QUuid::toString() const
162
163 Returns the string representation of the uuid.
164
166 Returns the variant of the UUID. The null UUID is considered to be of
167 an unknown variant.
168
169 See also version().
170
172 Returns the version of the UUID, if the UUID is of the DCE variant;
173 otherwise returns VerUnknown.
174
175 See also variant().
176
179 Writes the uuid id to the datastream s.
180
182 Reads uuid from from the stream s into id.
183
184
186 http://doc.trolltech.com/quuid.html
187 http://www.trolltech.com/faq/tech.html
188
190 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
191 license file included in the distribution for a complete license
192 statement.
193
195 Generated automatically from the source code.
196
198 If you find a bug in Qt, please report it as described in
199 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
200 help you. Thank you.
201
202 The definitive Qt documentation is provided in HTML format; it is
203 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
204 web browser. This man page is provided as a convenience for those users
205 who prefer man pages, although this format is not officially supported
206 by Trolltech.
207
208 If you find errors in this manual page, please report them to qt-
209 bugs@trolltech.com. Please include the name of the manual page
210 (quuid.3qt) and the Qt version (3.3.8).
211
212
213
214Trolltech AS 2 February 2007 QUuid(3qt)