Objective-C API Library Reference  4.3.0-42-g45f162a
 All Classes Functions Typedefs Properties Pages
Public Functions | Public Static Functions | Properties | List of all members
PWGuid Class Reference

The PWGuid class provides methods to create globally unique identifiers, and perform operations on them.

Wraps and extends the functionality of the underlying CFUUID implementation.

Constructors

(id) - initWithBytes:
 
(id) - initWithCFUUID:
 

Public Functions

(BOOL) - isEqual:
 
(BOOL) - isGuidEmpty
 
(NSString *) - stringValue
 

Public Static Functions

(PWGuid *) + createGuid
 
(PWGuid *) + emptyGuid
 
(PWGuid *) + guidWithBytes:
 
(PWGuid *) + guidWithCFUUID:
 
(PWGuid *) + guidWithInt:
 
(PWGuid *) + guidWithString:
 
(CFUUIDBytes) + resetBytes
 
(BOOL) + tryParseGuid:guidOut:
 

Properties

CFUUIDRef uuid
 

Methods Descriptions

+ (PWGuid *) createGuid

Creates a new PWGuid object.

+ (PWGuid *) emptyGuid

Returns a shared reference to an empty PWGuid object.

+ (PWGuid *) guidWithBytes: (CFUUIDBytes)  bytes

Creates a new PWGuid object using the specified source bytes.

+ (PWGuid *) guidWithCFUUID: (CFUUIDRef)  uuid

Creates a new PWGuid object using the specified source UUID.

+ (PWGuid *) guidWithInt: (NSUInteger)  intValue

Creates a new PWGuid object using the specified integer value.

+ (PWGuid *) guidWithString: (NSString *)  guidString

Attempts to create a PWGuid object using the specified string (case-insensitive).

Note
An exception will be raised if the values are out of range, or if the specified GUID string is not in the format 00000000-0000-0000-0000-000000000000. If this behavior is not desired, use the tryParseGuid method instead.
- (id) initWithBytes: (CFUUIDBytes)  bytes

Initializes the PWGuid object with the specified source UUID bytes.

- (id) initWithCFUUID: (CFUUIDRef)  uuid

Initializes the the PWGuid object with the specified UUID.

- (BOOL) isEqual: (PWGuid *)  guid

Compares two GUID values. Returns true if they are equal, otherwise returns false.

- (BOOL) isGuidEmpty

Returns a Boolean value indicating whether the GUID is empty (i.e. is equal to 00000000-0000-0000-0000-000000000000).

+ (CFUUIDBytes) resetBytes

Helper method to zero out the contents of the CFUUIDBytes structure.

- (NSString *) stringValue

Returns the string representation of the GUID in the lowercase format: 00000000-0000-0000-0000-000000000000.

+ (BOOL) tryParseGuid: (NSString *)  guidString
guidOut: (PWGuid **)  guidOut 

Attempts to create a PWGuid object using with the specified string (case-insensitive). Will return YES if the operation is successful, otherwise will return NO.

Parameters
guidStringThe source GUID, expressed as string, in the form 00000000-0000-0000-0000-000000000000
guidOutThe resulting GUID, if the operation is successful.

Properties Descriptions

- (CFUUIDRef) uuid
readnonatomicassign

The underlying CFUUID.