The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
More...
#include <QC_UUID.dox.h>
|
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.
|
|
The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
◆ compare()
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);
◆ constructor() [1/2]
Generates a UUID.
- Parameters
-
- Examples:
- to generate a UUID using the default algorithm:
The UUID class provides methods that allow UUIDs to be created, manipulated, and parsed.
Definition QC_UUID.dox.h:7
- 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:
const Empty
The UUID will be assigned the null value on creation.
Definition QC_UUID.dox.h:149
◆ constructor() [2/2]
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) |
◆ copy()
Qore::UUID::UUID::copy |
( |
| ) |
|
Creates an exact copy of the UUID object.
- Example:
copy()
Creates an exact copy of the UUID object.
◆ generate()
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:
◆ get()
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"
◆ isNull()
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();
◆ set()
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) |
◆ toString()
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: