Uuid::generateUuid()


#1

Here’s some code I added to juce_mac_SystemStats.cpp to get JUCE’s Uuid class working on the Mac:

[code]const String Uuid::generateUuid()
{
// create uuid
CFUUIDRef cfUUID = CFUUIDCreate(NULL);

// convert uuid to cfString and release it
CFStringRef cfUUIDString = CFUUIDCreateString(NULL, cfUUID);
CFRelease(cfUUID);

// convert cfString to JUCE string and release it
String sUUID = PlatformUtilities::cfStringToJuceString(cfUUIDString);
CFRelease(cfUUIDString);

// return JUCE string
return sUUID;

}[/code]


#2

Jules, if this passes muster, could you please add it to the next release?

Thanks.


#3

ok.

(sorry, I don’t think I noticed this post the first time round…)


#4