[190] | 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"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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 <<a href="quuid-h.html">quuid.h</a>></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 l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )</li>
|
---|
| 45 | <li class=fn><a href="#QUuid-3"><b>QUuid</b></a> ( const QUuid & orig )</li>
|
---|
| 46 | <li class=fn><a href="#QUuid-4"><b>QUuid</b></a> ( const QString & 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 & <a href="#operator-eq"><b>operator=</b></a> ( const QUuid & uuid )</li>
|
---|
| 51 | <li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QUuid & other ) const</li>
|
---|
| 52 | <li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QUuid & other ) const</li>
|
---|
| 53 | <li class=fn>bool <a href="#operator-lt"><b>operator<</b></a> ( const QUuid & other ) const</li>
|
---|
| 54 | <li class=fn>bool <a href="#operator-gt"><b>operator></b></a> ( const QUuid & 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 & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QUuid & id )</li>
|
---|
| 65 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QUuid & id )</li>
|
---|
| 66 | </ul>
|
---|
| 67 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | The QUuid class defines a Universally Unique Identifier (UUID).
|
---|
| 71 | <p>
|
---|
| 72 | <p> For objects or declarations that must be uniquely identified,
|
---|
| 73 | UUIDs (also known as GUIDs) are widely used in order to assign a
|
---|
| 74 | fixed and easy to compare value to the object or declaration. The
|
---|
| 75 | 128-bit value of a UUID is generated by an algorithm that
|
---|
| 76 | guarantees that the value is unique.
|
---|
| 77 | <p> In Qt, UUIDs are wrapped by the QUuid struct which provides
|
---|
| 78 | convenience functions for handling UUIDs. Most platforms provide a
|
---|
| 79 | tool 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
|
---|
| 83 | using the static <a href="#createUuid">createUuid</a>() function. They can be converted to a
|
---|
| 84 | string with <a href="#toString">toString</a>(). UUIDs have a <a href="#variant">variant</a>() and a <a href="#version">version</a>(),
|
---|
| 85 | and 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
|
---|
| 91 | which 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
|
---|
| 105 | MAC 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 l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar 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 <a href="quuid.html">QUuid</a> & 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 <a href="qstring.html">QString</a> & text )
|
---|
| 134 | </h3>
|
---|
| 135 | Creates a QUuid object from the string <em>text</em>. The function can
|
---|
| 136 | only convert a string in the format
|
---|
| 137 | {HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH} (where 'H' stands for a hex
|
---|
| 138 | digit). 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
|
---|
| 144 | UUIDs generated are based on the platform specific pseudo-random
|
---|
| 145 | generator, which is usually not a cryptographic-quality random
|
---|
| 146 | number generator. Therefore, a UUID is not guaranteed to be unique
|
---|
| 147 | cross application instances.
|
---|
| 148 | <p> On Windows, the new UUID is extremely likely to be unique on the
|
---|
| 149 | same 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>
|
---|
| 154 | Returns 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 <a href="quuid.html">QUuid</a> & other ) const
|
---|
| 164 | </h3>
|
---|
| 165 |
|
---|
| 166 | <p> Returns TRUE if this QUuid and the <em>other</em> QUuid are different;
|
---|
| 167 | otherwise returns FALSE.
|
---|
| 168 |
|
---|
| 169 | <h3 class=fn>bool <a name="operator-lt"></a>QUuid::operator< ( const <a href="quuid.html">QUuid</a> & other ) const
|
---|
| 170 | </h3>
|
---|
| 171 |
|
---|
| 172 | <p> Returns TRUE if this QUuid is of the same variant,
|
---|
| 173 | and lexicographically before the <em>other</em> QUuid;
|
---|
| 174 | otherwise returns FALSE.
|
---|
| 175 | <p> <p>See also <a href="#variant">variant</a>().
|
---|
| 176 |
|
---|
| 177 | <h3 class=fn><a href="quuid.html">QUuid</a> & <a name="operator-eq"></a>QUuid::operator= ( const <a href="quuid.html">QUuid</a> & 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 <a href="quuid.html">QUuid</a> & other ) const
|
---|
| 183 | </h3>
|
---|
| 184 |
|
---|
| 185 | <p> Returns TRUE if this QUuid and the <em>other</em> QUuid are identical;
|
---|
| 186 | otherwise returns FALSE.
|
---|
| 187 |
|
---|
| 188 | <h3 class=fn>bool <a name="operator-gt"></a>QUuid::operator> ( const <a href="quuid.html">QUuid</a> & other ) const
|
---|
| 189 | </h3>
|
---|
| 190 |
|
---|
| 191 | <p> Returns TRUE if this QUuid is of the same variant,
|
---|
| 192 | and lexicographically after the <em>other</em> QUuid;
|
---|
| 193 | otherwise 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.
|
---|
| 205 | The 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
|
---|
| 212 | variant; 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> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="quuid.html">QUuid</a> & id )
|
---|
| 217 | </h3>
|
---|
| 218 |
|
---|
| 219 | Writes the uuid <em>id</em> to the datastream <em>s</em>.
|
---|
| 220 |
|
---|
| 221 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="quuid.html">QUuid</a> & id )
|
---|
| 222 | </h3>
|
---|
| 223 |
|
---|
| 224 | Reads uuid from from the stream <em>s</em> into <em>id</em>.
|
---|
| 225 |
|
---|
| 226 | <!-- eof -->
|
---|
| 227 | <hr><p>
|
---|
| 228 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 229 | Copyright © 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 © 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>
|
---|