The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
More...
List of all members.
Public Member Functions |
| nothing | clear () |
| | Clears the UUID and sets the null value ("00000000-0000-0000-0000-000000000000")
|
| int | 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.
|
| | constructor (int flags=Qore::UUID::None) |
| | Generates a UUID.
|
| | constructor (string uuid_str) |
| | parses a string to construct a UUID
|
| | copy () |
| | Creates an exact copy of the UUID object.
|
| nothing | generate (int flags=Qore::UUID::None) |
| | Generates a new UUID value for the object; the current value of the UUID object is overwritten with the newly-generated value.
|
| bool | isNull () |
| | Returns True if the current UUID is the null UUID, or False if not.
|
| nothing | set (string uuid_str) |
| | sets the UUID from the given string
|
| string | toString (int flag=Qore::UUID::LowerCase) |
| | Returns the string representation of the UUID.
|
Detailed Description
The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
Member Function Documentation
| nothing Qore::UUID::UUID::clear |
( |
| ) |
|
Clears the UUID and sets the null value ("00000000-0000-0000-0000-000000000000")
| 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/svn/module-uuid/trunk/src/QC_UUID.dox.h