Undocumented NSString API
Undocumented NSString API
- Subject: Undocumented NSString API
- From: Norbert Heger <email@hidden>
- Date: Tue, 16 Oct 2001 23:04:35 +0200
I just discovered a bunch of quite useful (or at least useful sounding) but
unfortunately undocumented NSString methods. May we expect some of these
methods to become part of the official API one day, or do we have to
reinvent the wheel?
Best Regards, Norbert
_____________________________________________
Norbert Heger, Objective Development
http://www.obdev.at/
@interface NSString (Undocumented)
- (BOOL)isCanonical;
- (BOOL)isCaseInsensitiveLike:(id)object;
- (BOOL)isLike:(id)object;
- (BOOL)matchesPattern:(id)aPattern;
- (BOOL)matchesPattern:(id)aPattern caseInsensitive:(BOOL)flag;
- (id)mutableSubstringFromRange:(NSRange)aRange;
- (NSRange)significantText;
- (NSString *)stringByAddingPercentEscapes;
- (NSString *)stringByConvertingPathToURL;
- (NSString *)stringByConvertingURLToPath;
- (NSString *)stringByRemovingPercentEscapes;
- (NSString *)stringWithoutAmpersand;
- (NSString *)canonicalString;
- (NSString *)displayableString;
- (NSString *)quotedStringRepresentation;
- (NSString *)standardizedNativePath;
- (NSString *)standardizedURLPath;
- (NSString *)urlPathByAppendingComponent:(NSString *)component;
- (NSString *)urlPathByDeletingLastComponent;
- (NSString *)urlPathRelativeToPath:(NSString *)path;
- (NSString *)lowercaseStringWithLanguage:(NSString *)aLanguage;
- (NSString *)uppercaseStringWithLanguage:(NSString *)language;
- (NSString *)capitalizedStringWithLanguage:(NSString *)language;
- (NSRange)_rangeOfPrefixFittingWidth:(float)width withFont:(NSFont *)font;
- (NSRange)_rangeOfSuffixFittingWidth:(float)width withFont:(NSFont *)font;
- (NSRange)_rangeOfSuffixFittingWidth:(float)width
withAttributes:(id)attributes;
- (NSRange)_rangeOfPrefixFittingWidth:(float)width
withAttributes:(id)attributes;
- (unsigned int)_endOfParagraphAtIndex:(unsigned int)anIndex;
- (BOOL)_getFSRefForApplicationName:(FSRef *)ref;
- (BOOL)_getFSRefForPath:(FSRef *)ref;
- (BOOL)_getFSRefForServiceName:(FSRef *)ref;
- (BOOL)_getFSSpecForPath:(FSSpec *)spec;
- (BOOL)_getVRefNumForPath:(short *)vref;
+ (NSString *)_pathForFSRef:(FSRef *)ref;
@end
@interface NSMutableString (Undocumented)
- (void)_deleteAllCharactersFromSet:(NSSet *)aSet;
- (void)_replaceAllAppearancesOfString:(NSString *)aString
withString:(NSString *)aString;
- (void)_replaceFirstAppearanceOfString:(NSString *)aString
withString:(NSString *)aString;
- (void)_replaceLastAppearanceOfString:(NSString *)aString
withString:(NSString *)aString;
- (void)appendCString:(const char *)aString length:(int)aLength;
- (void)appendCharacter:(unsigned short)aCharacter;
- (void)appendCharacters:(const unsigned short *)characters
length:(int)aLength;
- (void)deleteLastCharacter;
- (void)insertString:(NSString *)aString atIndex:(unsigned int)anIndex;
- (void)replaceCharactersInRange:(NSRange)aRange
withCString:(const char *)cString length:(unsigned int)length;
- (void)replaceCharactersInRange:(NSRange)aRange
withCharacters:(const unsigned short *)characters
length:(unsigned int)length;
- (void)trimWhitespace;
@end