DOKK / manpages / debian 11 / libossp-uuid-dev / uuid++.3ossp.en
.::uuid++(3) Universally Unique Identifier .::uuid++(3)

uuid++ - Universally Unique Identifier (C++ API)

OSSP uuid 1.6.2 (04-Jul-2008)

uuid++ is the ISO-C++ language binding of the OSSP uuid C API. It provides a thin ISO-C++ class uuid wrapping the ISO-C API type uuid_t.

The ISO-C++ Application Programming Interface (API) of OSSP uuid consists of the following components:

CONSTANTS

The constants are the same to those provided by the ISO-C API. See uuid(3) for details.

CLASSES

The following classes are provided:

This is the class corresponding to the C API type uuid_t. It is the main object.
This is the class corresponding to the C API function uuid_error. It is the object thrown as an exception in case of any errors.

METHODS

The following methods are provided:

The standard constructor.
The copy constructor for uuid class.
The import constructor for C API objects.
The import constructor for binary representation.
The import constructor for string representation.
~uuid();
The standard destructor for uuid class.
The assignment operator corresponding to the copy constructor.
The assignment operator corresponding to the import constructor for C API objects.
The assignment operator corresponding to the import constructor for binary representation.
The assignment operator corresponding to the import constructor for string and single integer value representation.
Regular method corresponding to the C API function uuid_clone.
Regular method corresponding to the C API function uuid_load.
Regular method corresponding to the C API function uuid_make.
Regular method corresponding to the C API function uuid_isnil.
Regular method corresponding to the C API function uuid_compare.
The comparison operator corresponding to uuid_compare usage for equality.
The comparison operator corresponding to uuid_compare usage for inequality.
The comparison operator corresponding to uuid_compare usage for less-than.
The comparison operator corresponding to uuid_compare usage for less-than-or-equal.
The comparison operator corresponding to uuid_compare usage for greater-than.
The comparison operator corresponding to uuid_compare usage for greater-than-or-equal.
Regular method corresponding to the C API function uuid_import for binary representation usage.
Regular method corresponding to the C API function uuid_import for string representation usage.
Regular method corresponding to the C API function uuid_export for binary representation usage.
Regular method corresponding to the C API function uuid_export for string representation usage.
Regular method corresponding to the C API function uuid_export for single integer value representation usage.
Regular method corresponding to the C API function uuid_export for textual summary representation usage.
Regular method corresponding to the C API function uuid_version.
The standard constructor for uuid_error_t class.
The standard constructor for uuid_error_t class with return code initialization.
~uuid_error_t()
The standard destructor for uuid_error_t class.
Regular method for setting the return code.
Regular method for fetching the return code.
Regular method for fetching the string corresponding to the current return code.

The following shows an example usage of the C++ API. Exception handling is omitted for code simplification and has to be re-added for production code.

 /* generate a DCE 1.1 v1 UUID from system environment */
 char *uuid_v1(void)
 {
     uuid id;
     char *str;
     id.make(UUID_MAKE_V1);
     str = id.string();
     return str;
 }
 /* generate a DCE 1.1 v3 UUID from an URL */
 char *uuid_v3(const char *url)
 {
     uuid id;
     uuid id_ns;
     char *str;
     id_ns.load("ns:URL");
     id.make(UUID_MAKE_V3, &id_ns, url);
     str = id.string();
     return str;
 }

uuid(3).

OSSP uuid 1.6.2 04-Jul-2008