.::uuid++(3)
π .::uuid++ β the C++ glow-up of OSSP uuid π
okay bestie, sit DOWN, because this is uuid++, the ISO-C++ language binding of the OSSP uuid C API. π¦ It's a thin ISO-C++ class uuid that wraps the ISO-C API type uuid_t, and honestly? It's giving "same energy, cuter wrapper." π
β¨ VERSION β¨
OSSP uuid 1.6.2 (04-Jul-2008) β yeah she's vintage, she's iconic, she's still working. π
πΈ DESCRIPTION πΈ
uuid++ is the ISO-C++ language binding of the OSSP uuid C API. It hands you a thin ISO-C++ class uuid that wraps the ISO-C API type uuid_t. That's the whole vibe: no drama, no bloat, just C++ manners on top of C bones. π«Ά
π APPLICATION PROGRAMMING INTERFACE π
The ISO-C++ Application Programming Interface (API) of OSSP uuid is made up of these components, and we're going through every single one, no skips, no cap. π
π CONSTANTS π
The constants are the same to those provided by the ISO-C API. See uuid(3) for details. iykyk. β¨
π§ CLASSES π§
Here's the roster, bestie:
uuidβ This is the class corresponding to the C API typeuuid_t. It is the main object. Main character energy, fr fr. πuuid_error_tβ This is the class corresponding to the C API functionuuid_error. It is the object thrown as an exception in case of any errors. She's the drama, but the useful drama. π
π METHODS π
Here's every method, in order, exactly as promised:
uuid();β The standard constructor. πuuid(const uuid &_obj);β The copy constructor foruuidclass. Copy-paste, but make it classy. β¨uuid(const uuid_t *_obj);β The import constructor for C API objects.uuid(const void *_bin);β The import constructor for binary representation.uuid(const char *_str);β The import constructor for string representation.~uuid();β The standard destructor foruuidclass. She cleans up after herself. π§Ήuuid &uuid::operator=(const uuid &_obj);β The assignment operator corresponding to the copy constructor.uuid &uuid::operator=(const uuid_t *_obj);β The assignment operator corresponding to the import constructor for C API objects.uuid &uuid::operator=(const void *_bin);β The assignment operator corresponding to the import constructor for binary representation.uuid &uuid::operator=(const char *_str);β The assignment operator corresponding to the import constructor for string and single integer value representation.uuid uuid::clone(void);β Regular method corresponding to the C API functionuuid_clone.void uuid::load(const char *_name);β Regular method corresponding to the C API functionuuid_load.void uuid::make(unsigned int _mode, ...);β Regular method corresponding to the C API functionuuid_make.int uuid::isnil(void);β Regular method corresponding to the C API functionuuid_isnil.int uuid::compare(const uuid &_obj);β Regular method corresponding to the C API functionuuid_compare.int uuid::operator==(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for equality.int uuid::operator!=(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for inequality.int uuid::operator<(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for less-than.int uuid::operator<=(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for less-than-or-equal.int uuid::operator>(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for greater-than.int uuid::operator>=(const uuid &_obj);β The comparison operator corresponding touuid_compareusage for greater-than-or-equal.void uuid::import(const void *_bin);β Regular method corresponding to the C API functionuuid_importfor binary representation usage.void uuid::import(const char *_str);β Regular method corresponding to the C API functionuuid_importfor string representation usage.void *uuid::binary(void);β Regular method corresponding to the C API functionuuid_exportfor binary representation usage.char *uuid::string(void);β Regular method corresponding to the C API functionuuid_exportfor string representation usage.char *uuid::integer(void);β Regular method corresponding to the C API functionuuid_exportfor single integer value representation usage.char *uuid::summary(void);β Regular method corresponding to the C API functionuuid_exportfor textual summary representation usage.unsigned long uuid::version(void);β Regular method corresponding to the C API functionuuid_version.uuid_error_t()β The standard constructor foruuid_error_tclass.uuid_error_t(uuid_rc_t _code)β The standard constructor foruuid_error_tclass with return code initialization.~uuid_error_t()β The standard destructor foruuid_error_tclass.void uuid_error_t::code(uuid_rc_t _code)β Regular method for setting the return code.uuid_rc_t uuid_error_t::code(void)β Regular method for fetching the return code.char *uuid_error_t::string(void)β Regular method for fetching the string corresponding to the current return code.
π₯ EXAMPLE π₯
Here's the C++ API in action. Real talk though β exception handling is omitted for code simplification and has to be re-added for production code. Do not be out here shipping the simplified version, bestie, I'm begging. π
/* 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;
}
π«Ά Note bestie: exception handling was skipped up there for simplicity, and you have to add it back for production code. Non-negotiable.
π SEE ALSO π
and that's the whole page, bestie. π this was written up as OSSP uuid 1.6.2, dated 04-Jul-2008 β yeah, 2008, and she still ate. πβ¨ bye now, go generate some UUIDs. π
π¦ where this page comes from
- fedora 43: uuid-c++-devel 1.6.2-67.fc43 Β· MIT
- fedora 43: uuid-c++-devel 1.6.2-67.fc43 Β· MIT
- fedora 44: uuid-c++-devel 1.6.2-68.fc44 Β· MIT
- fedora 44: uuid-c++-devel 1.6.2-68.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms