2001-12-17 14:31:42 +00:00
|
|
|
/** NSCharacterSet - Character set holder
|
1998-11-10 20:16:33 +00:00
|
|
|
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
1995-05-05 21:03:04 +00:00
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
|
|
|
Date: Apr 1995
|
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-05-05 21:03:04 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1995-05-05 21:03:04 +00:00
|
|
|
*/
|
|
|
|
|
1997-11-06 00:51:23 +00:00
|
|
|
#include <config.h>
|
2001-03-26 23:09:44 +00:00
|
|
|
#include <Foundation/NSArray.h>
|
1995-08-30 21:31:29 +00:00
|
|
|
#include <Foundation/NSBitmapCharSet.h>
|
|
|
|
#include <Foundation/NSException.h>
|
|
|
|
#include <Foundation/NSBundle.h>
|
|
|
|
#include <Foundation/NSData.h>
|
1996-09-02 13:53:26 +00:00
|
|
|
#include <Foundation/NSLock.h>
|
2001-03-26 23:09:44 +00:00
|
|
|
#include <Foundation/NSPathUtilities.h>
|
1997-10-16 23:56:27 +00:00
|
|
|
#include <Foundation/NSDictionary.h>
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1999-04-23 02:54:45 +00:00
|
|
|
static NSString* NSCharacterSet_PATH = @"NSCharacterSets";
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
/* A simple array for caching standard bitmap sets */
|
1999-04-09 15:34:49 +00:00
|
|
|
#define MAX_STANDARD_SETS 15
|
1996-09-02 13:53:26 +00:00
|
|
|
static NSCharacterSet* cache_set[MAX_STANDARD_SETS];
|
|
|
|
static NSLock* cache_lock = nil;
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
@implementation NSCharacterSet
|
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
+ (void) initialize
|
|
|
|
{
|
|
|
|
static BOOL one_time = NO;
|
|
|
|
|
|
|
|
if (one_time == NO)
|
|
|
|
{
|
2001-11-07 16:24:55 +00:00
|
|
|
unsigned i;
|
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
for (i = 0; i < MAX_STANDARD_SETS; i++)
|
2001-11-07 16:24:55 +00:00
|
|
|
{
|
|
|
|
cache_set[i] = 0;
|
|
|
|
}
|
1996-09-02 13:53:26 +00:00
|
|
|
one_time = YES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1995-08-30 21:31:29 +00:00
|
|
|
/* Provide a default object for allocation */
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (id) allocWithZone: (NSZone*)zone
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
|
|
|
return NSAllocateObject([NSBitmapCharSet self], 0, zone);
|
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
// Creating standard character sets
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) _bitmapForSet: (NSString*)setname number: (int)number
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
2001-03-26 23:09:44 +00:00
|
|
|
NSCharacterSet *set;
|
|
|
|
NSArray *paths;
|
|
|
|
NSString *bundle_path, *set_path;
|
|
|
|
NSBundle *bundle;
|
|
|
|
NSEnumerator *enumerator;
|
1995-08-30 21:31:29 +00:00
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
if (!cache_lock)
|
|
|
|
cache_lock = [NSLock new];
|
|
|
|
[cache_lock lock];
|
|
|
|
|
|
|
|
set = nil; /* Quiet warnings */
|
|
|
|
if (cache_set[number] == nil)
|
1997-05-03 17:16:10 +00:00
|
|
|
{
|
|
|
|
NS_DURING
|
1997-10-16 23:56:27 +00:00
|
|
|
|
2001-03-26 23:09:44 +00:00
|
|
|
paths = NSSearchPathForDirectoriesInDomains(GSLibrariesDirectory,
|
|
|
|
NSAllDomainsMask, YES);
|
|
|
|
enumerator = [paths objectEnumerator];
|
|
|
|
while ((set == nil) && (bundle_path = [enumerator nextObject]))
|
|
|
|
{
|
|
|
|
bundle = [NSBundle bundleWithPath: bundle_path];
|
|
|
|
|
|
|
|
set_path = [bundle pathForResource: setname
|
|
|
|
ofType: @"dat"
|
|
|
|
inDirectory: NSCharacterSet_PATH];
|
|
|
|
if (set_path != nil)
|
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
/* Load the character set file */
|
|
|
|
set = [self characterSetWithBitmapRepresentation:
|
|
|
|
[NSData dataWithContentsOfFile: set_path]];
|
|
|
|
NS_HANDLER
|
|
|
|
NSLog(@"Unable to read NSCharacterSet file %@", set_path);
|
|
|
|
set = nil;
|
|
|
|
NS_ENDHANDLER
|
|
|
|
}
|
|
|
|
}
|
1996-09-02 13:53:26 +00:00
|
|
|
|
1997-10-16 23:56:27 +00:00
|
|
|
/* If we didn't load a set then raise an exception */
|
|
|
|
if (!set)
|
1996-09-02 13:53:26 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[NSException raise: NSGenericException
|
2001-03-19 23:53:23 +00:00
|
|
|
format: @"Could not find bitmap file %@", setname];
|
1996-09-02 13:53:26 +00:00
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
1997-10-16 23:56:27 +00:00
|
|
|
else
|
2001-11-07 16:24:55 +00:00
|
|
|
{
|
|
|
|
/* Else cache the set */
|
|
|
|
cache_set[number] = RETAIN(set);
|
1996-09-02 13:53:26 +00:00
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
}
|
1996-09-02 13:53:26 +00:00
|
|
|
NS_HANDLER
|
|
|
|
[cache_lock unlock];
|
1996-09-02 13:58:02 +00:00
|
|
|
[localException raise];
|
1996-09-02 15:52:46 +00:00
|
|
|
abort (); /* quiet warnings about `set' clobbered by longjmp. */
|
1996-09-02 13:53:26 +00:00
|
|
|
NS_ENDHANDLER
|
1995-08-30 21:31:29 +00:00
|
|
|
}
|
1996-09-02 13:53:26 +00:00
|
|
|
else
|
|
|
|
set = cache_set[number];
|
1995-08-30 21:31:29 +00:00
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
[cache_lock unlock];
|
|
|
|
return set;
|
1995-08-30 21:31:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) alphanumericCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"alphanumericCharSet" number: 0];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) controlCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self _bitmapForSet: @"controlCharSet" number: 1];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) decimalDigitCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"decimalDigitCharSet" number: 2];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) decomposableCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self _bitmapForSet: @"decomposableCharSet" number: 3];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) illegalCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self _bitmapForSet: @"illegalCharSet" number: 4];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) letterCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"letterCharSet" number: 5];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) lowercaseLetterCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"lowercaseLetterCharSet" number: 6];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) nonBaseCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"nonBaseCharSet" number: 7];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-12-17 14:31:42 +00:00
|
|
|
+ (NSCharacterSet*) punctuationCharacterSet
|
1998-11-16 19:36:51 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self _bitmapForSet: @"punctuationCharSet" number: 8];
|
1998-11-16 19:36:51 +00:00
|
|
|
}
|
|
|
|
|
2001-12-17 14:31:42 +00:00
|
|
|
+ (NSCharacterSet*) symbolAndOperatorCharacterSet
|
1999-04-09 15:34:49 +00:00
|
|
|
{
|
|
|
|
return [self _bitmapForSet: @"symbolAndOperatorCharSet" number: 9];
|
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) uppercaseLetterCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"uppercaseLetterCharSet" number: 10];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) whitespaceAndNewlineCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"whitespaceAndNlCharSet" number: 11];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) whitespaceCharacterSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-09 15:34:49 +00:00
|
|
|
return [self _bitmapForSet: @"whitespaceCharSet" number: 12];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Creating custom character sets
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) characterSetWithBitmapRepresentation: (NSData*)data
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-06-03 10:59:25 +00:00
|
|
|
return AUTORELEASE([[NSBitmapCharSet alloc] initWithBitmap: data]);
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) characterSetWithCharactersInString: (NSString*)aString
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
2001-11-07 16:24:55 +00:00
|
|
|
unsigned i;
|
|
|
|
unsigned length;
|
|
|
|
unsigned char *bytes;
|
1999-04-07 11:57:53 +00:00
|
|
|
NSMutableData *bitmap = [NSMutableData dataWithLength: BITMAP_SIZE];
|
1995-08-30 21:31:29 +00:00
|
|
|
|
|
|
|
if (!aString)
|
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[NSException raise: NSInvalidArgumentException
|
|
|
|
format: @"Creating character set with nil string"];
|
1995-08-30 21:31:29 +00:00
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
length = [aString length];
|
|
|
|
bytes = [bitmap mutableBytes];
|
2001-11-07 16:24:55 +00:00
|
|
|
for (i = 0; i < length; i++)
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
unichar letter = [aString characterAtIndex: i];
|
2001-11-07 16:24:55 +00:00
|
|
|
|
1995-08-30 21:31:29 +00:00
|
|
|
SETBIT(bytes[letter/8], letter % 8);
|
|
|
|
}
|
|
|
|
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self characterSetWithBitmapRepresentation: bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*)characterSetWithRange: (NSRange)aRange
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
2001-11-07 16:24:55 +00:00
|
|
|
unsigned i;
|
|
|
|
unsigned char *bytes;
|
1999-04-07 11:57:53 +00:00
|
|
|
NSMutableData *bitmap = [NSMutableData dataWithLength: BITMAP_SIZE];
|
1995-08-30 21:31:29 +00:00
|
|
|
|
|
|
|
if (NSMaxRange(aRange) > UNICODE_SIZE)
|
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[NSException raise: NSInvalidArgumentException
|
|
|
|
format: @"Specified range exceeds character set"];
|
1995-08-30 21:31:29 +00:00
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
bytes = (unsigned char*)[bitmap mutableBytes];
|
|
|
|
for (i = aRange.location; i < NSMaxRange(aRange); i++)
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
SETBIT(bytes[i/8], i % 8);
|
2001-11-07 16:24:55 +00:00
|
|
|
}
|
1999-04-07 11:57:53 +00:00
|
|
|
return [self characterSetWithBitmapRepresentation: bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) characterSetWithContentsOfFile: (NSString*)aFile
|
1998-11-10 20:16:33 +00:00
|
|
|
{
|
|
|
|
if ([@"bitmap" isEqual: [aFile pathExtension]])
|
|
|
|
{
|
|
|
|
NSData *bitmap = [NSData dataWithContentsOfFile: aFile];
|
|
|
|
return [self characterSetWithBitmapRepresentation: bitmap];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (NSData*) bitmapRepresentation
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (BOOL) characterIsMember: (unichar)aCharacter
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-07-29 09:22:18 +00:00
|
|
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1998-07-29 09:22:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithCoder: (NSCoder*)aCoder
|
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1998-07-29 09:22:18 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
1998-07-29 14:46:16 +00:00
|
|
|
- (BOOL) isEqual: (id)anObject
|
|
|
|
{
|
|
|
|
if (anObject == self)
|
|
|
|
return YES;
|
1999-04-07 11:57:53 +00:00
|
|
|
if ([anObject isKindOfClass: [NSCharacterSet class]])
|
1998-07-29 14:46:16 +00:00
|
|
|
{
|
2001-11-07 16:24:55 +00:00
|
|
|
unsigned i;
|
1998-07-29 14:46:16 +00:00
|
|
|
|
|
|
|
for (i = 0; i <= 0xffff; i++)
|
2001-11-07 16:24:55 +00:00
|
|
|
{
|
|
|
|
if ([self characterIsMember: (unichar)i]
|
|
|
|
!= [anObject characterIsMember: (unichar)i])
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
1998-07-29 14:46:16 +00:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (NSCharacterSet*) invertedSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
2001-11-07 16:24:55 +00:00
|
|
|
unsigned i;
|
|
|
|
unsigned length;
|
|
|
|
unsigned char *bytes;
|
|
|
|
NSMutableData *bitmap;
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1999-06-03 10:59:25 +00:00
|
|
|
bitmap = AUTORELEASE([[self bitmapRepresentation] mutableCopy]);
|
1995-08-30 21:31:29 +00:00
|
|
|
length = [bitmap length];
|
|
|
|
bytes = [bitmap mutableBytes];
|
2001-11-07 16:24:55 +00:00
|
|
|
for (i = 0; i < length; i++)
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
bytes[i] = ~bytes[i];
|
2001-11-07 16:24:55 +00:00
|
|
|
}
|
1999-04-07 11:57:53 +00:00
|
|
|
return [[self class] characterSetWithBitmapRepresentation: bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
1995-08-30 21:31:29 +00:00
|
|
|
|
|
|
|
// NSCopying, NSMutableCopying
|
2001-11-07 16:24:55 +00:00
|
|
|
- (id) copyWithZone: (NSZone*)zone
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
|
|
|
if (NSShouldRetainWithZone(self, zone))
|
1999-06-03 10:59:25 +00:00
|
|
|
return RETAIN(self);
|
1995-05-05 21:03:04 +00:00
|
|
|
else
|
1999-06-03 10:59:25 +00:00
|
|
|
return NSCopyObject (self, 0, zone);
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (id) mutableCopyWithZone: (NSZone*)zone
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
NSData *bitmap;
|
|
|
|
bitmap = [self bitmapRepresentation];
|
1999-04-07 11:57:53 +00:00
|
|
|
return [[NSMutableBitmapCharSet allocWithZone: zone] initWithBitmap: bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation NSMutableCharacterSet
|
|
|
|
|
1995-08-30 21:31:29 +00:00
|
|
|
/* Provide a default object for allocation */
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (id) allocWithZone: (NSZone*)zone
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
|
|
|
return NSAllocateObject([NSMutableBitmapCharSet self], 0, zone);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Override this from NSCharacterSet to create the correct class */
|
2001-11-07 16:24:55 +00:00
|
|
|
+ (NSCharacterSet*) characterSetWithBitmapRepresentation: (NSData*)data
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
1999-06-03 10:59:25 +00:00
|
|
|
return AUTORELEASE([[NSMutableBitmapCharSet alloc] initWithBitmap: data]);
|
1995-08-30 21:31:29 +00:00
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
/* Mutable subclasses must implement ALL of these methods. */
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) addCharactersInRange: (NSRange)aRange
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) addCharactersInString: (NSString*)aString
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) formUnionWithCharacterSet: (NSCharacterSet*)otherSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) formIntersectionWithCharacterSet: (NSCharacterSet*)otherSet
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) removeCharactersInRange: (NSRange)aRange
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) removeCharactersInString: (NSString*)aString
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (void) invert
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
[self subclassResponsibility: _cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NSCopying, NSMutableCopying
|
2001-11-07 16:24:55 +00:00
|
|
|
- (id) copyWithZone: (NSZone*)zone
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
NSData *bitmap;
|
|
|
|
bitmap = [self bitmapRepresentation];
|
1999-04-07 11:57:53 +00:00
|
|
|
return [[NSBitmapCharSet allocWithZone: zone] initWithBitmap: bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
2001-11-07 16:24:55 +00:00
|
|
|
- (id) mutableCopyWithZone: (NSZone*)zone
|
1995-05-05 21:03:04 +00:00
|
|
|
{
|
1999-04-07 11:57:53 +00:00
|
|
|
return [super mutableCopyWithZone: zone];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|