1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

UUID: Add size() getter to facilitate safer access to bytes

This commit is contained in:
reuk 2024-05-20 14:56:22 +01:00
parent d7788100d5
commit a59904af64
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -128,6 +128,9 @@ public:
*/
const uint8* getRawData() const noexcept { return uuid; }
/** Returns the size in bytes of the raw data making up this UUID. */
static constexpr size_t size() { return sizeInBytes; }
/** Creates a UUID from a 16-byte array.
@see getRawData
*/
@ -136,10 +139,10 @@ public:
/** Sets this UUID from 16-bytes of raw data. */
Uuid& operator= (const uint8* rawData) noexcept;
private:
//==============================================================================
uint8 uuid[16];
static constexpr size_t sizeInBytes = 16;
uint8 uuid[sizeInBytes];
String getHexRegion (int, int) const;
int compare (Uuid) const noexcept;