| Derived from | |
| Framework | CoreFoundation/CoreFoundation.h |
| Companion guide | |
| Declared in | CFUUID.h |
CFUUID objects are used by plug-ins to uniquely identify types, interfaces, and factories. When creating a new type, host developers must generate UUIDs to identify the type as well as its interfaces and factories.
UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values guaranteed to be unique. A UUID is made unique over both space and time by combining a value unique to the computer on which it was generated—usually the Ethernet hardware address—and a value representing the number of 100-nanosecond intervals since October 15, 1582 at 00:00:00.
The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067. The hex representation looks, as you might expect, like a list of numerical values preceded by 0x. For example, 0xD7, 0x36, 0x95, 0x0A, 0x4D, 0x6E, 0x12, 0x26, 0x80, 0x3A, 0x00, 0x50, 0xE4, 0xC0, 0x00, 0x67 . To use a UUID, you simply create it and then copy the resulting strings into your header and C language source files. Because a UUID is expressed simply as an array of bytes, there are no endianness considerations for different platforms.
You can create a CFUUID object, and thereby generate a UUID, using any one of the CFUUIDCreate... functions. Use the CFUUIDGetConstantUUIDWithBytes function if you want to declare a UUID constant in a #define statement. You can get the raw bytes of an existing CFUUID object using the CFUUIDGetUUIDBytes function.
Creates a Universally Unique Identifier (UUID) object.
CFUUIDRef CFUUIDCreate ( CFAllocatorRef alloc );
The allocator to use to allocate memory for the new CFUUID object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
A new CFUUID object. Ownership follows the Create Rule.
CFUUID.hCreates a CFUUID object for a specified string.
CFUUIDRef CFUUIDCreateFromString ( CFAllocatorRef alloc, CFStringRef uuidStr );
The allocator to use to allocate memory for the new CFUUID object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
A string containing a UUID. The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067.
A new CFUUID object, or if a CFUUID object of the same value already exists, the existing instance with its reference count incremented. Ownership follows the Create Rule.
CFUUID.hCreates a CFUUID object from raw UUID bytes.
CFUUIDRef CFUUIDCreateFromUUIDBytes ( CFAllocatorRef alloc, CFUUIDBytes bytes );
The allocator to use to allocate memory for the new CFUUID object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
Raw UUID bytes to use to create the CFUUID object.
A new CFUUID object. Ownership follows the Create Rule.
CFUUID.hReturns the string representation of a specified CFUUID object.
CFStringRef CFUUIDCreateString ( CFAllocatorRef alloc, CFUUIDRef uuid );
The allocator to use to allocate memory for the new string. Pass NULL or kCFAllocatorDefault to use the current default allocator.
The CFUUID object whose string representation to obtain.
The string representation of uuid. Ownership follows the Create Rule.
CFUUID.hCreates a CFUUID object from raw UUID bytes.
CFUUIDRef CFUUIDCreateWithBytes ( CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15 );
The allocator to use to allocate memory for the new CFUUID object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
Raw byte number 0.
Raw byte number 1.
Raw byte number 2.
Raw byte number 3.
Raw byte number 4.
Raw byte number 5.
Raw byte number 6.
Raw byte number 7.
Raw byte number 8.
Raw byte number 9.
Raw byte number 10.
Raw byte number 11.
Raw byte number 12.
Raw byte number 13.
Raw byte number 14.
Raw byte number 15.
A new CFUUID object, or, if a CFUUID object of the same value already exists, the existing instance with its reference count incremented. Ownership follows the Create Rule.
.
CFUUID.hReturns a CFUUID object from raw UUID bytes.
CFUUIDRef CFUUIDGetConstantUUIDWithBytes ( CFAllocatorRef alloc, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15 );
The allocator to use to allocate memory for the new CFUUID object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
Raw byte number 0.
Raw byte number 1.
Raw byte number 2.
Raw byte number 3.
Raw byte number 4.
Raw byte number 5.
Raw byte number 6.
Raw byte number 7.
Raw byte number 8.
Raw byte number 9.
Raw byte number 10.
Raw byte number 11.
Raw byte number 12.
Raw byte number 13.
Raw byte number 14.
Raw byte number 15.
A CFUUID object. Ownership follows the Get Rule.
This function can be used in headers to declare a UUID constant with #define.
CFUUID.hReturns the type identifier for all CFUUID objects.
CFTypeID CFUUIDGetTypeID ( void );
The type identifier for the CFUUID opaque type.
CFUUID.hReturns the value of a UUID object as raw bytes.
CFUUIDBytes CFUUIDGetUUIDBytes ( CFUUIDRef uuid );
The CFUUID object to examine.
The value of uuid represented as raw bytes.
CFUUID.hA 128-bit struct that represents a UUID as raw bytes.
typedef struct {
UInt8 byte0;
UInt8 byte1;
UInt8 byte2;
UInt8 byte3;
UInt8 byte4;
UInt8 byte5;
UInt8 byte6;
UInt8 byte7;
UInt8 byte8;
UInt8 byte9;
UInt8 byte10;
UInt8 byte11;
UInt8 byte12;
UInt8 byte13;
UInt8 byte14;
UInt8 byte15;
} CFUUIDBytes;
byte0The first byte.
byte1The second byte.
byte2The third byte.
byte3The fourth byte.
byte4The fifth byte.
byte5The sixth byte.
byte6The seventh byte.
byte7The eighth byte.
byte8The ninth byte.
byte9The tenth byte.
byte10The eleventh byte.
byte11The twelfth byte.
byte12The thirteenth byte.
byte13The fourteenth byte.
byte14The fifteenth byte.
byte15The sixteenth byte.
This structure can be obtained from a CFUUID object using the CFUUIDGetUUIDBytes function. This structure is can be passed to functions that expect a raw UUID.
CFUUID.hA reference to a CFUUID object.
typedef const struct __CFUUID *CFUUIDRef;
CFUUID.hLast updated: 2007-01-15