scclib
Stable Cloud Computing C++ Library
Public Member Functions | Static Public Attributes | List of all members
scc::crypto::Uuid Class Reference

Universally unique identifier (uuid). More...

#include <uuid.h>

Collaboration diagram for scc::crypto::Uuid:
Collaboration graph
[legend]

Public Member Functions

 Uuid (Uuid &&)=delete
 
 Uuid (Uuid &b)
 
Uuidoperator= (const Uuid &b)
 Copy assignment operator.
 
Uuidoperator= (const std::string &b)
 String copy assignment operator. More...
 
 Uuid (const std::string &s)
 String initializer. More...
 
std::string generate ()
 Generate a new uuid. More...
 
 operator std::string () const
 A uuid may be used as a string.
 
std::string val () const
 Return the uuid value.
 
bool operator== (const Uuid &b) const
 Equality operator.
 
bool operator!= (const Uuid &b) const
 Not equals operator.
 

Static Public Attributes

static const std::string zero = "00000000-0000-0000-0000-000000000000"
 Zero uuid is 00000000-0000-0000-000000000000.
 

Detailed Description

Universally unique identifier (uuid).

Uuid's are 36 digit strings, with 8-4-4-12 hex encoded digits. All hex digits are lower case.

If an invalid uuid is constructed or assigned, the value is set to Uuid::zero.

Examples
crypto/unittest/uuid.cc.

Definition at line 62 of file uuid.h.

Constructor & Destructor Documentation

◆ Uuid()

scc::crypto::Uuid::Uuid ( const std::string &  s)
inline

String initializer.

If an invalid uuid is passed, sets to zero without error.

Definition at line 102 of file uuid.h.

Member Function Documentation

◆ generate()

std::string Uuid::generate ( )

Generate a new uuid.

Returns the new value.

Definition at line 95 of file uuid.cc.

◆ operator=()

Uuid& scc::crypto::Uuid::operator= ( const std::string &  b)
inline

String copy assignment operator.

If an invalid uuid is passed, sets to zero without error.

Definition at line 92 of file uuid.h.


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