Eneboo - Documentación para desarrolladores
|
The QUuid class defines a Universally Unique Identifier (UUID). Más...
#include <quuid.h>
Tipos públicos | |
enum | Variant { VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7, VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7 } |
enum | Version { VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4, VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4 } |
enum | Variant { VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7, VarUnknown = -1, NCS = 0, DCE = 2, Microsoft = 6, Reserved = 7 } |
enum | Version { VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4, VerUnknown = -1, Time = 1, EmbeddedPOSIX = 2, Name = 3, Random = 4 } |
Métodos públicos | |
QUuid () | |
QUuid (uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) | |
QUuid (const QUuid &uuid) | |
QUuid (const QString &) | |
QUuid (const char *) | |
QString | toString () const |
operator QString () const | |
bool | isNull () const |
QUuid & | operator= (const QUuid &orig) |
bool | operator== (const QUuid &orig) const |
bool | operator!= (const QUuid &orig) const |
bool | operator< (const QUuid &other) const |
bool | operator> (const QUuid &other) const |
QUuid::Variant | variant () const |
QUuid::Version | version () const |
QUuid () | |
QUuid (uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) | |
QUuid (const QUuid &uuid) | |
QUuid (const QString &) | |
QUuid (const char *) | |
QString | toString () const |
operator QString () const | |
bool | isNull () const |
QUuid & | operator= (const QUuid &orig) |
bool | operator== (const QUuid &orig) const |
bool | operator!= (const QUuid &orig) const |
bool | operator< (const QUuid &other) const |
bool | operator> (const QUuid &other) const |
QUuid::Variant | variant () const |
QUuid::Version | version () const |
Métodos públicos estáticos | |
static QUuid | createUuid () |
static QUuid | createUuid () |
Atributos públicos | |
uint | data1 |
ushort | data2 |
ushort | data3 |
uchar | data4 [8] |
Funciones relacionadas | |
(Observar que estas no son funciones miembro.) | |
QDataStream & | operator<< (QDataStream &s, const QUuid &id) |
QDataStream & | operator>> (QDataStream &s, QUuid &id) |
The QUuid class defines a Universally Unique Identifier (UUID).
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.
In Qt, UUIDs are wrapped by the QUuid struct which provides convenience functions for handling UUIDs. Most platforms provide a tool to generate new UUIDs, for example, uuidgen and guidgen.
UUIDs generated by QUuid, are based on the Random
version of the DCE
(Distributed Computing Environment) standard.
UUIDs can be constructed from numeric values or from strings, or using the static createUuid() function. They can be converted to a string with toString(). UUIDs have a variant() and a version(), and null UUIDs return TRUE from isNull().
enum QUuid::Variant |
This enum defines the variant of the UUID, which is the scheme which defines the layout of the 128-bits value.
VarUnknown Variant is unknown NCS Reserved for NCS (Network Computing System) backward compatibility DCE Distributed Computing Environment, the scheme used by QUuid Microsoft Reserved for Microsoft backward compatibility (GUID) Reserved Reserved for future definition
enum QUuid::Variant |
enum QUuid::Version |
enum QUuid::Version |
This enum defines the version of the UUID.
VerUnknown Version is unknown Time Time-based, by using timestamp, clock sequence, and MAC network card address (if available) for the node sections EmbeddedPOSIX DCE Security version, with embedded POSIX UUIDs Name Name-based, by using values from a name for all sections Random Random-based, by using random numbers for all sections
QUuid::QUuid | ( | ) | [inline] |
Creates the null UUID {00000000-0000-0000-0000-000000000000}.
QUuid::QUuid | ( | uint | l, |
ushort | w1, | ||
ushort | w2, | ||
uchar | b1, | ||
uchar | b2, | ||
uchar | b3, | ||
uchar | b4, | ||
uchar | b5, | ||
uchar | b6, | ||
uchar | b7, | ||
uchar | b8 | ||
) | [inline] |
Creates a UUID with the value specified by the parameters, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8.
Example:
// {67C8770B-44F1-410A-AB9A-F9B5446F13EE} QUuid IID_MyInterface( 0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee )
QUuid::QUuid | ( | const QString & | text | ) |
Creates a QUuid object from the string text. 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.
QUuid::QUuid | ( | const char * | text | ) |
QUuid::QUuid | ( | ) | [inline] |
QUuid::QUuid | ( | uint | l, |
ushort | w1, | ||
ushort | w2, | ||
uchar | b1, | ||
uchar | b2, | ||
uchar | b3, | ||
uchar | b4, | ||
uchar | b5, | ||
uchar | b6, | ||
uchar | b7, | ||
uchar | b8 | ||
) | [inline] |
QUuid::QUuid | ( | const QUuid & | uuid | ) | [inline] |
QUuid::QUuid | ( | const QString & | ) |
QUuid::QUuid | ( | const char * | ) |
QUuid QUuid::createUuid | ( | ) | [static] |
Returns a new UUID of DCE
variant, and Random
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.
On Windows, the new UUID is extremely likely to be unique on the same or any other system, networked or not.
static QUuid QUuid::createUuid | ( | ) | [static] |
bool QUuid::isNull | ( | ) | const |
Returns TRUE if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns FALSE.
bool QUuid::isNull | ( | ) | const |
QUuid::operator QString | ( | ) | const [inline] |
QUuid::operator QString | ( | ) | const [inline] |
Returns the string representation of the uuid.
Assigns the value of uuid to this QUuid object.
QString QUuid::toString | ( | ) | const |
QString QUuid::toString() const
Returns the string representation of the uuid.
QString QUuid::toString | ( | ) | const |
QUuid::Variant QUuid::variant | ( | ) | const |
Returns the variant of the UUID. The null UUID is considered to be of an unknown variant.
QUuid::Variant QUuid::variant | ( | ) | const |
QUuid::Version QUuid::version | ( | ) | const |
Returns the version of the UUID, if the UUID is of the DCE variant; otherwise returns VerUnknown.
QUuid::Version QUuid::version | ( | ) | const |
QDataStream & operator<< | ( | QDataStream & | s, |
const QUuid & | id | ||
) | [related] |
Writes the uuid id to the datastream s.
QDataStream & operator>> | ( | QDataStream & | s, |
QUuid & | id | ||
) | [related] |
Reads uuid from from the stream s into id.