source: trunk/doc/html/quuid.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 11.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/tools/quuid.cpp:40 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QUuid Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QUuid Class Reference</h1>
33
34<p>The QUuid class defines a Universally Unique Identifier (UUID).
35<a href="#details">More...</a>
36<p>All the functions in this class are <a href="threads.html#reentrant">reentrant</a> when Qt is built with thread support.</p>
37<p><tt>#include &lt;<a href="quuid-h.html">quuid.h</a>&gt;</tt>
38<p><a href="quuid-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn>enum <a href="#Variant-enum"><b>Variant</b></a> { VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7 }</li>
42<li class=fn>enum <a href="#Version-enum"><b>Version</b></a> { VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4 }</li>
43<li class=fn><a href="#QUuid"><b>QUuid</b></a> ()</li>
44<li class=fn><a href="#QUuid-2"><b>QUuid</b></a> ( uint&nbsp;l, ushort&nbsp;w1, ushort&nbsp;w2, uchar&nbsp;b1, uchar&nbsp;b2, uchar&nbsp;b3, uchar&nbsp;b4, uchar&nbsp;b5, uchar&nbsp;b6, uchar&nbsp;b7, uchar&nbsp;b8 )</li>
45<li class=fn><a href="#QUuid-3"><b>QUuid</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;orig )</li>
46<li class=fn><a href="#QUuid-4"><b>QUuid</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text )</li>
47<li class=fn>QString <a href="#toString"><b>toString</b></a> () const</li>
48<li class=fn><a href="#operator-QString"><b>operator QString</b></a> () const</li>
49<li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
50<li class=fn>QUuid &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;uuid )</li>
51<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;other ) const</li>
52<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;other ) const</li>
53<li class=fn>bool <a href="#operator-lt"><b>operator&lt;</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;other ) const</li>
54<li class=fn>bool <a href="#operator-gt"><b>operator&gt;</b></a> ( const&nbsp;QUuid&nbsp;&amp;&nbsp;other ) const</li>
55<li class=fn>QUuid::Variant <a href="#variant"><b>variant</b></a> () const</li>
56<li class=fn>QUuid::Version <a href="#version"><b>version</b></a> () const</li>
57</ul>
58<h2>Static Public Members</h2>
59<ul>
60<li class=fn>QUuid <a href="#createUuid"><b>createUuid</b></a> ()</li>
61</ul>
62<h2>Related Functions</h2>
63<ul>
64<li class=fn>QDataStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, const&nbsp;QUuid&nbsp;&amp;&nbsp;id )</li>
65<li class=fn>QDataStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( QDataStream&nbsp;&amp;&nbsp;s, QUuid&nbsp;&amp;&nbsp;id )</li>
66</ul>
67<hr><a name="details"></a><h2>Detailed Description</h2>
68
69
70The QUuid class defines a Universally Unique Identifier (UUID).
71<p>
72<p> For objects or declarations that must be uniquely identified,
73UUIDs (also known as GUIDs) are widely used in order to assign a
74fixed and easy to compare value to the object or declaration. The
75128-bit value of a UUID is generated by an algorithm that
76guarantees that the value is unique.
77<p> In Qt, UUIDs are wrapped by the QUuid struct which provides
78convenience functions for handling UUIDs. Most platforms provide a
79tool to generate new UUIDs, for example, uuidgen and guidgen.
80<p> UUIDs generated by QUuid, are based on the <a href="#Version-enum">Random</a> version of the
81<a href="#Variant-enum">DCE</a> (Distributed Computing Environment) standard.
82<p> UUIDs can be constructed from numeric values or from strings, or
83using the static <a href="#createUuid">createUuid</a>() function. They can be converted to a
84string with <a href="#toString">toString</a>(). UUIDs have a <a href="#variant">variant</a>() and a <a href="#version">version</a>(),
85and null UUIDs return TRUE from <a href="#isNull">isNull</a>().
86
87<hr><h2>Member Type Documentation</h2>
88<h3 class=fn><a name="Variant-enum"></a>QUuid::Variant</h3>
89
90<p> This enum defines the variant of the UUID, which is the scheme
91which defines the layout of the 128-bits value.
92<ul>
93<li><tt>QUuid::VarUnknown</tt> - Variant is unknown
94<li><tt>QUuid::NCS</tt> - Reserved for NCS (Network Computing System) backward compatibility
95<li><tt>QUuid::DCE</tt> - Distributed Computing Environment, the scheme used by QUuid
96<li><tt>QUuid::Microsoft</tt> - Reserved for Microsoft backward compatibility (GUID)
97<li><tt>QUuid::Reserved</tt> - Reserved for future definition
98</ul>
99<h3 class=fn><a name="Version-enum"></a>QUuid::Version</h3>
100
101<p> This enum defines the version of the UUID.
102<ul>
103<li><tt>QUuid::VerUnknown</tt> - Version is unknown
104<li><tt>QUuid::Time</tt> - Time-based, by using timestamp, clock sequence, and
105MAC network card address (if available) for the node sections
106<li><tt>QUuid::EmbeddedPOSIX</tt> - DCE Security version, with embedded POSIX UUIDs
107<li><tt>QUuid::Name</tt> - Name-based, by using values from a name for all sections
108<li><tt>QUuid::Random</tt> - Random-based, by using random numbers for all sections
109</ul>
110<hr><h2>Member Function Documentation</h2>
111<h3 class=fn><a name="QUuid"></a>QUuid::QUuid ()
112</h3>
113
114<p> Creates the null UUID {00000000-0000-0000-0000-000000000000}.
115
116<h3 class=fn><a name="QUuid-2"></a>QUuid::QUuid ( uint&nbsp;l, ushort&nbsp;w1, ushort&nbsp;w2, uchar&nbsp;b1, uchar&nbsp;b2, uchar&nbsp;b3, uchar&nbsp;b4, uchar&nbsp;b5, uchar&nbsp;b6, uchar&nbsp;b7, uchar&nbsp;b8 )
117</h3>
118
119<p> Creates a UUID with the value specified by the parameters, <em>l</em>,
120<em>w1</em>, <em>w2</em>, <em>b1</em>, <em>b2</em>, <em>b3</em>, <em>b4</em>, <em>b5</em>, <em>b6</em>, <em>b7</em>, <em>b8</em>.
121<p> Example:
122<pre>
123 // {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
124 QUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee )
125 </pre>
126
127
128<h3 class=fn><a name="QUuid-3"></a>QUuid::QUuid ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;orig )
129</h3>
130
131<p> Creates a copy of the QUuid <em>orig</em>.
132
133<h3 class=fn><a name="QUuid-4"></a>QUuid::QUuid ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text )
134</h3>
135Creates a QUuid object from the string <em>text</em>. The function can
136only convert a string in the format
137{HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH} (where 'H' stands for a hex
138digit). If the conversion fails a null UUID is created.
139
140<h3 class=fn><a href="quuid.html">QUuid</a> <a name="createUuid"></a>QUuid::createUuid ()<tt> [static]</tt>
141</h3>
142
143<p> Returns a new UUID of <a href="#Variant-enum">DCE</a> variant, and <a href="#Version-enum">Random</a> type. The
144UUIDs generated are based on the platform specific pseudo-random
145generator, which is usually not a cryptographic-quality random
146number generator. Therefore, a UUID is not guaranteed to be unique
147cross application instances.
148<p> On Windows, the new UUID is extremely likely to be unique on the
149same or any other system, networked or not.
150<p> <p>See also <a href="#variant">variant</a>() and <a href="#version">version</a>().
151
152<h3 class=fn>bool <a name="isNull"></a>QUuid::isNull () const
153</h3>
154Returns TRUE if this is the null UUID
155{00000000-0000-0000-0000-000000000000}; otherwise returns FALSE.
156
157<h3 class=fn><a name="operator-QString"></a>QUuid::operator QString () const
158</h3>
159
160<p> Returns the string representation of the uuid.
161<p> <p>See also <a href="#toString">toString</a>().
162
163<h3 class=fn>bool <a name="operator!-eq"></a>QUuid::operator!= ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;other ) const
164</h3>
165
166<p> Returns TRUE if this QUuid and the <em>other</em> QUuid are different;
167otherwise returns FALSE.
168
169<h3 class=fn>bool <a name="operator-lt"></a>QUuid::operator&lt; ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;other ) const
170</h3>
171
172<p> Returns TRUE if this QUuid is of the same variant,
173and lexicographically before the <em>other</em> QUuid;
174otherwise returns FALSE.
175<p> <p>See also <a href="#variant">variant</a>().
176
177<h3 class=fn><a href="quuid.html">QUuid</a>&nbsp;&amp; <a name="operator-eq"></a>QUuid::operator= ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;uuid )
178</h3>
179
180<p> Assigns the value of <em>uuid</em> to this QUuid object.
181
182<h3 class=fn>bool <a name="operator-eq-eq"></a>QUuid::operator== ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;other ) const
183</h3>
184
185<p> Returns TRUE if this QUuid and the <em>other</em> QUuid are identical;
186otherwise returns FALSE.
187
188<h3 class=fn>bool <a name="operator-gt"></a>QUuid::operator&gt; ( const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;other ) const
189</h3>
190
191<p> Returns TRUE if this QUuid is of the same variant,
192and lexicographically after the <em>other</em> QUuid;
193otherwise returns FALSE.
194<p> <p>See also <a href="#variant">variant</a>().
195
196<h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QUuid::toString () const
197</h3>
198<a href="qstring.html">QString</a> <a href="#toString">QUuid::toString</a>() const
199<p> Returns the string representation of the uuid.
200
201<h3 class=fn><a href="quuid.html#Variant-enum">QUuid::Variant</a> <a name="variant"></a>QUuid::variant () const
202</h3>
203
204<p> Returns the variant of the UUID.
205The null UUID is considered to be of an unknown variant.
206<p> <p>See also <a href="#version">version</a>().
207
208<h3 class=fn><a href="quuid.html#Version-enum">QUuid::Version</a> <a name="version"></a>QUuid::version () const
209</h3>
210
211<p> Returns the version of the UUID, if the UUID is of the DCE
212variant; otherwise returns VerUnknown.
213<p> <p>See also <a href="#variant">variant</a>().
214
215<hr><h2>Related Functions</h2>
216<h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, const&nbsp;<a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;id )
217</h3>
218
219Writes the uuid <em>id</em> to the datastream <em>s</em>.
220
221<h3 class=fn><a href="qdatastream.html">QDataStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;s, <a href="quuid.html">QUuid</a>&nbsp;&amp;&nbsp;id )
222</h3>
223
224Reads uuid from from the stream <em>s</em> into <em>id</em>.
225
226<!-- eof -->
227<hr><p>
228This file is part of the <a href="index.html">Qt toolkit</a>.
229Copyright &copy; 1995-2007
230<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
231<table width=100% cellspacing=0 border=0><tr>
232<td>Copyright &copy; 2007
233<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
234<td align=right><div align=right>Qt 3.3.8</div>
235</table></div></address></body>
236</html>
Note: See TracBrowser for help on using the repository browser.