ftp.nice.ch/Attic/openStep/tools/workspace/TheShelf.0.3.3.sd.tgz#/TheShelf.0.3.3.sd/Source/NSString+MiscPathComparing.m

This is NSString+MiscPathComparing.m in view mode; [Download] [Up]

/*************************************************************************
 * File Name: NSString+MiscPathComparing.h
 * Version  : 0.0 alpha
 * Date     : Tue 02-Sep-1997
 *************************************************************************
 *  COPYWHAT (C) 1997 by Tomi Engel
 *
 * This notice may not be removed from this source code.
 * The use and distribution of this software is governed by the
 * terms of the MiscKit license agreement.  Refer to the license
 * document included with the MiscKit distribution for the terms.
 *                    ALL RIGHTS RESERVED
 *
 *************************************************************************
 * Notes      :
 * Bugs       :
 * Author(s)  : tsengel
 * Last update: $Date: 1997/09/02 12:00:12 $
 * History    : $Log: NSString+MiscPathComparing.h,v $
 * History    : Revision 1.1  1997/09/02 12:00:12  tsengel
 * History    : Create category to add more convenience methods
 * History    :
 *************************************************************************/

#import "NSString+MiscPathComparing.h"

@implementation NSString (MiscPathComparing)

/*"
    These are conveninec methods for comparing pathes whicha re useful if an array of path string needs to be sorted by specific criteria.
"*/

- (NSComparisonResult)compareByPathExtension:(NSString *)otherPathString
{
    return [[self pathExtension] compare:[otherPathString pathExtension]];
}

- (NSComparisonResult)compareByLastPathComponent:(NSString *)otherPathString
{
    return [[self lastPathComponent] compare:[otherPathString lastPathComponent]];
}

// <<NOTE>>  what about a NSOBject generic... compareByValueForSelector:@selector()... hmm... but that can't be passed
// to the sorting mechanism...hmmm.

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.