Loading...
Searching...
No Matches
juce_Uuid.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API Uuid
{
public:
//==============================================================================
Uuid();
~Uuid() noexcept;
Uuid (const Uuid&) noexcept;
Uuid& operator= (const Uuid&) noexcept;
//==============================================================================
bool isNull() const noexcept;
static Uuid null() noexcept;
bool operator== (const Uuid&) const noexcept;
bool operator!= (const Uuid&) const noexcept;
bool operator< (const Uuid&) const noexcept;
bool operator> (const Uuid&) const noexcept;
bool operator<= (const Uuid&) const noexcept;
bool operator>= (const Uuid&) const noexcept;
//==============================================================================
String toString() const;
String toDashedString() const;
Uuid (const String& uuidString);
Uuid& operator= (const String& uuidString);
//==============================================================================
uint32 getTimeLow() const noexcept;
uint16 getTimeMid() const noexcept;
uint16 getTimeHighAndVersion() const noexcept;
uint8 getClockSeqAndReserved() const noexcept;
uint8 getClockSeqLow() const noexcept;
uint64 getNode() const noexcept;
uint64 hash() const noexcept;
//==============================================================================
const uint8* getRawData() const noexcept { return uuid; }
Uuid (const uint8* rawData) noexcept;
Uuid& operator= (const uint8* rawData) noexcept;
private:
//==============================================================================
uint8 uuid[16];
String getHexRegion (int, int) const;
int compare (Uuid) const noexcept;
JUCE_LEAK_DETECTOR (Uuid)
};
} // namespace juce
#ifndef DOXYGEN
namespace std
{
template <> struct hash<juce::Uuid>
{
size_t operator() (const juce::Uuid& u) const noexcept { return (size_t) u.hash(); }
};
}
#endif
juce::String
Definition juce_String.h:53
juce::Uuid
Definition juce_Uuid.h:39
juce::Uuid::hash
uint64 hash() const noexcept
Definition juce_Uuid.cpp:137
juce::Uuid::Uuid
Uuid()
Definition juce_Uuid.cpp:26
juce::Uuid::toString
String toString() const
Definition juce_Uuid.cpp:87
juce::Uuid::getClockSeqAndReserved
uint8 getClockSeqAndReserved() const noexcept
Definition juce_Uuid.cpp:133
juce::Uuid::getTimeMid
uint16 getTimeMid() const noexcept
Definition juce_Uuid.cpp:131
juce::Uuid::getTimeLow
uint32 getTimeLow() const noexcept
Definition juce_Uuid.cpp:130
juce::Uuid::getClockSeqLow
uint8 getClockSeqLow() const noexcept
Definition juce_Uuid.cpp:134
juce::Uuid::getTimeHighAndVersion
uint16 getTimeHighAndVersion() const noexcept
Definition juce_Uuid.cpp:132
juce::Uuid::isNull
bool isNull() const noexcept
Definition juce_Uuid.cpp:73
juce::Uuid::toDashedString
String toDashedString() const
Definition juce_Uuid.cpp:92
juce::Uuid::getNode
uint64 getNode() const noexcept
Definition juce_Uuid.cpp:135
juce::Uuid::getRawData
const uint8 * getRawData() const noexcept
Definition juce_Uuid.h:117
juce::Uuid::null
static Uuid null() noexcept
Definition juce_Uuid.cpp:68