summaryrefslogtreecommitdiffstats
path: root/doc/html/ntquuid.html
blob: 1c80d0878ef756d66b4b6898b8eadb9fff291d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/tools/quuid.cpp:40 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQUuid Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQUuid Class Reference</h1>

<p>The TQUuid class defines a Universally Unique Identifier (UUID).
<a href="#details">More...</a>
<p>All the functions in this class are <a href="threads.html#reentrant">reentrant</a> when TQt is built with thread support.</p>
<p><tt>#include &lt;<a href="quuid-h.html">ntquuid.h</a>&gt;</tt>
<p><a href="quuid-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Variant-enum"><b>Variant</b></a> { VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7 }</li>
<li class=fn>enum <a href="#Version-enum"><b>Version</b></a> { VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4 }</li>
<li class=fn><a href="#TQUuid"><b>TQUuid</b></a> ()</li>
<li class=fn><a href="#TQUuid-2"><b>TQUuid</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>
<li class=fn><a href="#TQUuid-3"><b>TQUuid</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;orig )</li>
<li class=fn><a href="#TQUuid-4"><b>TQUuid</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;text )</li>
<li class=fn>TQString <a href="#toString"><b>toString</b></a> () const</li>
<li class=fn><a href="#operator-TQString"><b>operator TQString</b></a> () const</li>
<li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
<li class=fn>TQUuid &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;uuid )</li>
<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;other ) const</li>
<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;other ) const</li>
<li class=fn>bool <a href="#operator-lt"><b>operator&lt;</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;other ) const</li>
<li class=fn>bool <a href="#operator-gt"><b>operator&gt;</b></a> ( const&nbsp;TQUuid&nbsp;&amp;&nbsp;other ) const</li>
<li class=fn>TQUuid::Variant <a href="#variant"><b>variant</b></a> () const</li>
<li class=fn>TQUuid::Version <a href="#version"><b>version</b></a> () const</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>TQUuid <a href="#createUuid"><b>createUuid</b></a> ()</li>
</ul>
<h2>Related Functions</h2>
<ul>
<li class=fn>TQDataStream &amp; <a href="#operator-lt-lt"><b>operator&lt;&lt;</b></a> ( TQDataStream&nbsp;&amp;&nbsp;s, const&nbsp;TQUuid&nbsp;&amp;&nbsp;id )</li>
<li class=fn>TQDataStream &amp; <a href="#operator-gt-gt"><b>operator&gt;&gt;</b></a> ( TQDataStream&nbsp;&amp;&nbsp;s, TQUuid&nbsp;&amp;&nbsp;id )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQUuid class defines a Universally Unique Identifier (UUID).
<p> 
<p> For objects or declarations that must be uniquely identified,
UUIDs (also known as GUIDs) are widely used in order to assign a
fixed and easy to compare value to the object or declaration. The
128-bit value of a UUID is generated by an algorithm that
guarantees that the value is unique.
<p> In TQt, UUIDs are wrapped by the TQUuid struct which provides
convenience functions for handling UUIDs. Most platforms provide a
tool to generate new UUIDs, for example, uuidgen and guidgen.
<p> UUIDs generated by TQUuid, are based on the <a href="#Version-enum">Random</a> version of the
<a href="#Variant-enum">DCE</a> (Distributed Computing Environment) standard.
<p> UUIDs can be constructed from numeric values or from strings, or
using the static <a href="#createUuid">createUuid</a>() function. They can be converted to a
string with <a href="#toString">toString</a>(). UUIDs have a <a href="#variant">variant</a>() and a <a href="#version">version</a>(),
and null UUIDs return TRUE from <a href="#isNull">isNull</a>().

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Variant-enum"></a>TQUuid::Variant</h3>

<p> This enum defines the variant of the UUID, which is the scheme
which defines the layout of the 128-bits value.
<ul>
<li><tt>TQUuid::VarUnknown</tt> - Variant is unknown
<li><tt>TQUuid::NCS</tt> - Reserved for NCS (Network Computing System) backward compatibility
<li><tt>TQUuid::DCE</tt> - Distributed Computing Environment, the scheme used by TQUuid
<li><tt>TQUuid::Microsoft</tt> - Reserved for Microsoft backward compatibility (GUID)
<li><tt>TQUuid::Reserved</tt> - Reserved for future definition
</ul>
<h3 class=fn><a name="Version-enum"></a>TQUuid::Version</h3>

<p> This enum defines the version of the UUID.
<ul>
<li><tt>TQUuid::VerUnknown</tt> - Version is unknown
<li><tt>TQUuid::Time</tt> - Time-based, by using timestamp, clock sequence, and
MAC network card address (if available) for the node sections
<li><tt>TQUuid::EmbeddedPOSIX</tt> - DCE Security version, with embedded POSIX UUIDs
<li><tt>TQUuid::Name</tt> - Name-based, by using values from a name for all sections
<li><tt>TQUuid::Random</tt> - Random-based, by using random numbers for all sections
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQUuid"></a>TQUuid::TQUuid ()
</h3>

<p> Creates the null UUID {00000000-0000-0000-0000-000000000000}.

<h3 class=fn><a name="TQUuid-2"></a>TQUuid::TQUuid ( 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 )
</h3>

<p> Creates a UUID with the value specified by the parameters, <em>l</em>,
<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>.
<p> Example:
<pre>
    // {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
    TQUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee )
    </pre>
 

<h3 class=fn><a name="TQUuid-3"></a>TQUuid::TQUuid ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;orig )
</h3>

<p> Creates a copy of the TQUuid <em>orig</em>.

<h3 class=fn><a name="TQUuid-4"></a>TQUuid::TQUuid ( const&nbsp;<a href="tqstring.html">TQString</a>&nbsp;&amp;&nbsp;text )
</h3>
Creates a TQUuid object from the string <em>text</em>. The function can
only convert a string in the format
{HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH} (where 'H' stands for a hex
digit). If the conversion fails a null UUID is created.

<h3 class=fn><a href="ntquuid.html">TQUuid</a> <a name="createUuid"></a>TQUuid::createUuid ()<tt> [static]</tt>
</h3>

<p> Returns a new UUID of <a href="#Variant-enum">DCE</a> variant, and <a href="#Version-enum">Random</a> type. The
UUIDs generated are based on the platform specific pseudo-random
generator, which is usually not a cryptographic-quality random
number generator. Therefore, a UUID is not guaranteed to be unique
cross application instances.
<p> On Windows, the new UUID is extremely likely to be unique on the
same or any other system, networked or not.
<p> <p>See also <a href="#variant">variant</a>() and <a href="#version">version</a>().

<h3 class=fn>bool <a name="isNull"></a>TQUuid::isNull () const
</h3>
Returns TRUE if this is the null UUID
{00000000-0000-0000-0000-000000000000}; otherwise returns FALSE.

<h3 class=fn><a name="operator-TQString"></a>TQUuid::operator TQString () const
</h3>

<p> Returns the string representation of the uuid.
<p> <p>See also <a href="#toString">toString</a>().

<h3 class=fn>bool <a name="operator!-eq"></a>TQUuid::operator!= ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;other ) const
</h3>

<p> Returns TRUE if this TQUuid and the <em>other</em> TQUuid are different;
otherwise returns FALSE.

<h3 class=fn>bool <a name="operator-lt"></a>TQUuid::operator&lt; ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;other ) const
</h3>

<p> Returns TRUE if this TQUuid is of the same variant,
and lexicographically before the <em>other</em> TQUuid;
otherwise returns FALSE.
<p> <p>See also <a href="#variant">variant</a>().

<h3 class=fn><a href="ntquuid.html">TQUuid</a>&nbsp;&amp; <a name="operator-eq"></a>TQUuid::operator= ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;uuid )
</h3>

<p> Assigns the value of <em>uuid</em> to this TQUuid object.

<h3 class=fn>bool <a name="operator-eq-eq"></a>TQUuid::operator== ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;other ) const
</h3>

<p> Returns TRUE if this TQUuid and the <em>other</em> TQUuid are identical;
otherwise returns FALSE.

<h3 class=fn>bool <a name="operator-gt"></a>TQUuid::operator&gt; ( const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;other ) const
</h3>

<p> Returns TRUE if this TQUuid is of the same variant,
and lexicographically after the <em>other</em> TQUuid;
otherwise returns FALSE.
<p> <p>See also <a href="#variant">variant</a>().

<h3 class=fn><a href="tqstring.html">TQString</a> <a name="toString"></a>TQUuid::toString () const
</h3>
<a href="tqstring.html">TQString</a> <a href="#toString">TQUuid::toString</a>() const
<p> Returns the string representation of the uuid.

<h3 class=fn><a href="ntquuid.html#Variant-enum">TQUuid::Variant</a> <a name="variant"></a>TQUuid::variant () const
</h3>

<p> Returns the variant of the UUID.
The null UUID is considered to be of an unknown variant.
<p> <p>See also <a href="#version">version</a>().

<h3 class=fn><a href="ntquuid.html#Version-enum">TQUuid::Version</a> <a name="version"></a>TQUuid::version () const
</h3>

<p> Returns the version of the UUID, if the UUID is of the DCE
variant; otherwise returns VerUnknown.
<p> <p>See also <a href="#variant">variant</a>().

<hr><h2>Related Functions</h2>
<h3 class=fn><a href="ntqdatastream.html">TQDataStream</a>&nbsp;&amp; <a name="operator-lt-lt"></a>operator&lt;&lt; ( <a href="ntqdatastream.html">TQDataStream</a>&nbsp;&amp;&nbsp;s, const&nbsp;<a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;id )
</h3>

Writes the uuid <em>id</em> to the datastream <em>s</em>.

<h3 class=fn><a href="ntqdatastream.html">TQDataStream</a>&nbsp;&amp; <a name="operator-gt-gt"></a>operator&gt;&gt; ( <a href="ntqdatastream.html">TQDataStream</a>&nbsp;&amp;&nbsp;s, <a href="ntquuid.html">TQUuid</a>&nbsp;&amp;&nbsp;id )
</h3>

Reads uuid from from the stream <em>s</em> into <em>id</em>.

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>