[Darwine] WineHelper NSString_WHExtension.h NSString_WHExtension.m
Status: Pre-Alpha
Brought to you by:
jimwhite
From: Emmanuel M. <ma...@us...> - 2007-08-08 18:32:06
|
Update of /cvsroot/darwine/WineHelper In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv29745 Modified Files: NSString_WHExtension.h NSString_WHExtension.m Log Message: - implement -(NSString *) lastDOSPathComponent Index: NSString_WHExtension.h =================================================================== RCS file: /cvsroot/darwine/WineHelper/NSString_WHExtension.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- NSString_WHExtension.h 15 Oct 2006 17:32:34 -0000 1.1.1.1 +++ NSString_WHExtension.h 8 Aug 2007 18:31:59 -0000 1.2 @@ -27,4 +27,5 @@ - (NSString *) stringByTrimmingEndingSpaces; - (NSString *) absoluteWineBundlePath; - (NSString *) relativePathToAbsolute; +- (NSString *) lastDOSPathComponent; @end Index: NSString_WHExtension.m =================================================================== RCS file: /cvsroot/darwine/WineHelper/NSString_WHExtension.m,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- NSString_WHExtension.m 15 Oct 2006 17:32:34 -0000 1.1.1.1 +++ NSString_WHExtension.m 8 Aug 2007 18:31:59 -0000 1.2 @@ -43,4 +43,13 @@ { return relative_path_to_absolute(self); } + +- (NSString *) lastDOSPathComponent +{ + unsigned pos = [self length]; + + while (pos > 0 && [self characterAtIndex: pos - 1] != '\\') + pos--; + return [self substringFromIndex: pos]; +} @end |