Browse Source

Added a Uuid::null variable.

tags/2021-05-28
jules 11 years ago
parent
commit
8f2c2353e1
2 changed files with 5 additions and 0 deletions
  1. +2
    -0
      modules/juce_core/misc/juce_Uuid.cpp
  2. +3
    -0
      modules/juce_core/misc/juce_Uuid.h

+ 2
- 0
modules/juce_core/misc/juce_Uuid.cpp View File

@@ -51,6 +51,8 @@ Uuid& Uuid::operator= (const Uuid& other) noexcept
bool Uuid::operator== (const Uuid& other) const noexcept { return memcmp (uuid, other.uuid, sizeof (uuid)) == 0; } bool Uuid::operator== (const Uuid& other) const noexcept { return memcmp (uuid, other.uuid, sizeof (uuid)) == 0; }
bool Uuid::operator!= (const Uuid& other) const noexcept { return ! operator== (other); } bool Uuid::operator!= (const Uuid& other) const noexcept { return ! operator== (other); }
Uuid Uuid::null ((const uint8*) nullptr);
bool Uuid::isNull() const noexcept bool Uuid::isNull() const noexcept
{ {
for (size_t i = 0; i < sizeof (uuid); ++i) for (size_t i = 0; i < sizeof (uuid); ++i)


+ 3
- 0
modules/juce_core/misc/juce_Uuid.h View File

@@ -60,6 +60,9 @@ public:
/** Returns true if the ID is zero. */ /** Returns true if the ID is zero. */
bool isNull() const noexcept; bool isNull() const noexcept;
/** A static null Uuid object. */
static Uuid null;
bool operator== (const Uuid& other) const noexcept; bool operator== (const Uuid& other) const noexcept;
bool operator!= (const Uuid& other) const noexcept; bool operator!= (const Uuid& other) const noexcept;


Loading…
Cancel
Save