40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
_bytes[6] &= ~((1 << 7) | (1 << 5) | (1 << 4));
_bytes[6] |= (1 << 6);
_bytes[8] &= ~(1 << 6);
_bytes[8] |= (1 << 7);
return self;
}
- (bool)isEqual: (id)object
{
OFUUID *UUID;
if (![object isKindOfClass: [OFUUID class]])
return false;
|
>
>
>
>
>
>
>
>
>
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
_bytes[6] &= ~((1 << 7) | (1 << 5) | (1 << 4));
_bytes[6] |= (1 << 6);
_bytes[8] &= ~(1 << 6);
_bytes[8] |= (1 << 7);
return self;
}
- (instancetype)initWithUUIDBytes: (const unsigned char [16])bytes
{
self = [super init];
memcpy(_bytes, bytes, sizeof(_bytes));
return self;
}
- (bool)isEqual: (id)object
{
OFUUID *UUID;
if (![object isKindOfClass: [OFUUID class]])
return false;
|
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
return OFOrderedSame;
if (comparison > 0)
return OFOrderedDescending;
else
return OFOrderedAscending;
}
- (OFString *)UUIDString
{
return [OFString stringWithFormat:
@"%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-"
@"%02X%02X%02X%02X%02X%02X",
_bytes[0], _bytes[1], _bytes[2], _bytes[3],
|
>
>
>
>
>
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
return OFOrderedSame;
if (comparison > 0)
return OFOrderedDescending;
else
return OFOrderedAscending;
}
- (void)getUUIDBytes: (unsigned char [16])bytes
{
memcpy(bytes, _bytes, sizeof(_bytes));
}
- (OFString *)UUIDString
{
return [OFString stringWithFormat:
@"%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-"
@"%02X%02X%02X%02X%02X%02X",
_bytes[0], _bytes[1], _bytes[2], _bytes[3],
|