implement NSString compare:options:range

Thanks to Cacaodev for the ticket and initial stab at this.

[#105 state:resolved milestone:0.6]
This commit is contained in:
Ross Boucher committed 2008-11-10 10:29:46 -08:00
1 parent 9b764caf79
commit 88f12bad93
1 file changed
+15
+15
View File
@@ -452,6 +452,21 @@ var CPStringHashes = new objj_dictionary();
return CPOrderedSame;
}
/*!
Compares the receiver to the specified string, using options in range.
@param aString the string with which to compare the range of the receiver specified by range.
@param aMask the options to use for the comparison
@param range the range of the receiver over which to perform the comparison. The range must not exceed the bounds of the receiver.
@return the result of the comparison
*/
- (CPComparisonResult)compare:(CPString)aString options:(int)aMask range:(CPRange)range
{
var lhs = [self substringWithRange:range],
rhs = aString;
return [lhs compare:rhs options:aMask];
}
/*!
Returns <code>YES</code> if the receiver starts
with the specified string. If <code>aString</code>