1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
|
- (BOOL)isEqual: (id)object
{
OFAutoreleasePool *pool;
OFString *otherString;
const of_unichar_t *unicodeString, *otherUnicodeString;
size_t length;
if (![object isKindOfClass: [OFString class]])
return NO;
otherString = object;
length = [self length];
|
>
>
>
|
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
|
- (BOOL)isEqual: (id)object
{
OFAutoreleasePool *pool;
OFString *otherString;
const of_unichar_t *unicodeString, *otherUnicodeString;
size_t length;
if (object == self)
return YES;
if (![object isKindOfClass: [OFString class]])
return NO;
otherString = object;
length = [self length];
|
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
|
- (of_comparison_result_t)compare: (id)object
{
OFAutoreleasePool *pool;
OFString *otherString;
const of_unichar_t *unicodeString, *otherUnicodeString;
size_t i, minimumLength;
if (![object isKindOfClass: [OFString class]])
@throw [OFInvalidArgumentException exceptionWithClass: isa
selector: _cmd];
otherString = object;
minimumLength = ([self length] > [otherString length]
? [otherString length] : [self length]);
|
>
>
>
|
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
|
- (of_comparison_result_t)compare: (id)object
{
OFAutoreleasePool *pool;
OFString *otherString;
const of_unichar_t *unicodeString, *otherUnicodeString;
size_t i, minimumLength;
if (object == self)
return OF_ORDERED_SAME;
if (![object isKindOfClass: [OFString class]])
@throw [OFInvalidArgumentException exceptionWithClass: isa
selector: _cmd];
otherString = object;
minimumLength = ([self length] > [otherString length]
? [otherString length] : [self length]);
|
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
|
}
- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
const of_unichar_t *string, *otherUnicodeString;
size_t i, length, otherLength, minimumLength;
string = [self unicodeString];
otherUnicodeString = [otherString unicodeString];
length = [self length];
otherLength = [otherString length];
minimumLength = (length > otherLength ? otherLength : length);
|
>
>
>
|
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
|
}
- (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
const of_unichar_t *string, *otherUnicodeString;
size_t i, length, otherLength, minimumLength;
if (otherString == self)
return OF_ORDERED_SAME;
string = [self unicodeString];
otherUnicodeString = [otherString unicodeString];
length = [self length];
otherLength = [otherString length];
minimumLength = (length > otherLength ? otherLength : length);
|