The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
More...
The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
int Qore::UUID::UUID::compare |
( |
UUID |
other | ) |
|
Compares the current UUID with another UUID and returns -1, 0, or 1 if the other UUID is greater than, equal to, or less than the current UUID respectively.
- Code Flags:
- CONSTANT
- Parameters
-
other | the other UUID to compare |
- Returns
- -1, 0, or 1 if the other UUID is greater than, equal to, or less than the current UUID respectively
- Example:
my int $rc = $uuid.compare($other_uuid);
Generates a UUID.
- Parameters
-
- Examples:
- to generate a UUID using the default algorithm:
- to make a UUID object from an explicit value:
my UUID $uuid("93c40733-9b99-46c6-91a5-f3989067dc1e");
- to create a UUID with the null value:
Qore::UUID::UUID::constructor |
( |
string |
uuid_str | ) |
|
parses a string to construct a UUID
- Parameters
-
uuid_str | a UUID string in a format as in the following example: "93c40733-9b99-46c6-91a5-f3989067dc1e" |
- Example:
- to make a UUID object from an explicit value:
my UUID $uuid("93c40733-9b99-46c6-91a5-f3989067dc1e");
- Exceptions
-
UUID-STRING-ERROR | invalid UUID string (invalid format, invalid characters, etc) |
Qore::UUID::UUID::copy |
( |
| ) |
|
Creates an exact copy of the UUID object.
- Example:
my UUID $new_uuid = $uuid.copy();
Generates a new UUID value for the object; the current value of the UUID object is overwritten with the newly-generated value.
- Parameters
-
- Examples:
- to generate a UUID using the default algorithm:
- to create a UUID with the null value:
Returns a UUID string without having to create a UUID object.
- Code Flags:
- CONSTANT
- Parameters
-
- Returns
- the string representation of the UUID according to the arguments, ex:
"f5c5fd74-5b3e-4f02-8772-f8a80da9b028"
bool Qore::UUID::UUID::isNull |
( |
| ) |
|
Returns True if the current UUID is the null UUID, or False if not.
- Returns
- True if the current UUID is the null UUID, or False if not
- Code Flags:
- CONSTANT
- Example:
my bool $b = $uuid.isNull();
nothing Qore::UUID::UUID::set |
( |
string |
uuid_str | ) |
|
sets the UUID from the given string
- Parameters
-
uuid_str | a UUID string in a format as in the following example: "93c40733-9b99-46c6-91a5-f3989067dc1e" |
- Example:
$uuid.set("93c40733-9b99-46c6-91a5-f3989067dc1e");
- Exceptions
-
UUID-STRING-ERROR | invalid UUID string (invalid format, invalid characters, etc) |
Returns the string representation of the UUID.
- Code Flags:
- CONSTANT
- Parameters
-
- Returns
- the string representation of the UUID, ex:
"f5c5fd74-5b3e-4f02-8772-f8a80da9b028"
- Example:
my string $str = $uuid.toString();
The documentation for this class was generated from the following file:
- /export/home/dnichols/src/qore/git/module-uuid/src/QC_UUID.dox.h