RADLib
RADical C++ application framework
RADCore::RADUuid Class Reference

128-bit UUID helper. More...

#include <RADCore.h>

Public Member Functions

 RADUuid ()
 Creates a null UUID. More...
 
 RADUuid (std::array< uint8_t, 16 > bytes)
 Creates a UUID from raw bytes. More...
 
std::string toString () const
 Formats as canonical UUID text. More...
 
bool isNull () const
 Returns true when all UUID bytes are zero. More...
 
const std::array< uint8_t, 16 > & bytes () const
 Returns raw UUID bytes. More...
 

Static Public Member Functions

static RADUuid createUuid ()
 Creates a random UUID. More...
 
static std::optional< RADUuidfromString (const std::string &text)
 Parses canonical UUID text. More...
 

Detailed Description

128-bit UUID helper.

Constructor & Destructor Documentation

◆ RADUuid() [1/2]

RADCore::RADUuid::RADUuid ( )

Creates a null UUID.

◆ RADUuid() [2/2]

RADCore::RADUuid::RADUuid ( std::array< uint8_t, 16 >  bytes)
explicit

Creates a UUID from raw bytes.

Member Function Documentation

◆ bytes()

const std::array<uint8_t, 16>& RADCore::RADUuid::bytes ( ) const

Returns raw UUID bytes.

◆ createUuid()

static RADUuid RADCore::RADUuid::createUuid ( )
static

Creates a random UUID.

◆ fromString()

static std::optional<RADUuid> RADCore::RADUuid::fromString ( const std::string &  text)
static

Parses canonical UUID text.

◆ isNull()

bool RADCore::RADUuid::isNull ( ) const

Returns true when all UUID bytes are zero.

◆ toString()

std::string RADCore::RADUuid::toString ( ) const

Formats as canonical UUID text.


The documentation for this class was generated from the following file: