283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
- (int)compare: (id)obj
{
if (![obj isKindOf: [OFString class]])
@throw [OFInvalidArgumentException newWithClass: [self class]];
return strcmp(string, [obj cString]);
}
- append: (OFString*)str
{
return [self appendCString: [str cString]];
}
- appendCString: (const char*)str
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
- (int)compare: (id)obj
{
if (![obj isKindOf: [OFString class]])
@throw [OFInvalidArgumentException newWithClass: [self class]];
return strcmp(string, [obj cString]);
}
- (uint32_t)hash
{
uint32_t hash;
size_t i;
OF_HASH_INIT(hash);
for (i = 0; i < length; i++)
OF_HASH_ADD(hash, string[i]);
OF_HASH_FINALIZE(hash);
return hash;
}
- append: (OFString*)str
{
return [self appendCString: [str cString]];
}
- appendCString: (const char*)str
|