Qore UUID Module  1.2
 All Classes Namespaces Functions Variables Groups
Qore::UUID::UUID Class Reference

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.

Static Public Member Functions

static string get (int str_flag=Qore::UUID::LowerCase, int gen_flags=Qore::UUID::None)
 Returns a UUID string without having to create a UUID object.

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:
otherthe 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);
Qore::UUID::UUID::constructor ( int  flags = Qore::UUID::None)

Generates a UUID.

Parameters:
flagsUUID Generation Constants combined with binary or to affect how the UUID is generated
Examples:
  • to generate a UUID using the default algorithm:
    my UUID $uuid();
  • 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:
    my UUID $uuid(UUID::Empty);
Qore::UUID::UUID::constructor ( string  uuid_str)

parses a string to construct a UUID

Parameters:
uuid_stra 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-ERRORinvalid 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();
nothing Qore::UUID::UUID::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.

Parameters:
flagsUUID Generation Constants combined with binary or to affect how the UUID is generated
Examples:
  • to generate a UUID using the default algorithm:
    $uuid.generate();
  • to create a UUID with the null value:
    $uuid.generate(UUID::Empty);
static string Qore::UUID::UUID::get ( int  str_flag = Qore::UUID::LowerCase,
int  gen_flags = Qore::UUID::None 
)
static

Returns a UUID string without having to create a UUID object.

Code Flags:
CONSTANT
Parameters:
str_flagone of the UUID Formatting Constants to affect the formatting of the UUID string output
gen_flagsUUID Generation Constants combined with binary or to affect how the UUID is generated
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_stra 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-ERRORinvalid UUID string (invalid format, invalid characters, etc)
string Qore::UUID::UUID::toString ( int  flag = Qore::UUID::LowerCase)

Returns the string representation of the UUID.

Code Flags:
CONSTANT
Parameters:
flagone of the UUID Formatting Constants to affect the formatting of the UUID string output
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: