1995-05-05 21:03:04 +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
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
1997-11-06 00:51:23 +00:00
|
|
|
#include <config.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>
|
1997-10-16 23:56:27 +00:00
|
|
|
#include <Foundation/NSProcessInfo.h>
|
|
|
|
#include <Foundation/NSDictionary.h>
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1997-10-16 23:56:27 +00:00
|
|
|
static NSString* NSCharacterSet_PATH = @"gnustep/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 */
|
|
|
|
#define MAX_STANDARD_SETS 12
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < MAX_STANDARD_SETS; i++)
|
|
|
|
cache_set[i] = 0;
|
|
|
|
one_time = YES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1995-08-30 21:31:29 +00:00
|
|
|
/* Provide a default object for allocation */
|
|
|
|
+ allocWithZone:(NSZone *)zone
|
|
|
|
{
|
|
|
|
return NSAllocateObject([NSBitmapCharSet self], 0, zone);
|
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
// Creating standard character sets
|
|
|
|
|
1996-09-02 13:53:26 +00:00
|
|
|
+ (NSCharacterSet *) _bitmapForSet: (NSString *)setname number: (int)number
|
1995-08-30 21:31:29 +00:00
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
NSCharacterSet* set;
|
1997-10-16 23:56:27 +00:00
|
|
|
NSString *user_path, *local_path, *system_path;
|
|
|
|
NSBundle *user_bundle = nil, *local_bundle = nil, *system_bundle = nil;
|
|
|
|
NSProcessInfo *pInfo;
|
|
|
|
NSDictionary *env;
|
|
|
|
NSMutableString *user, *local, *system;
|
|
|
|
|
|
|
|
/*
|
|
|
|
The path of where to search for the resource files
|
|
|
|
is based upon environment variables.
|
|
|
|
GNUSTEP_USER_ROOT
|
|
|
|
GNUSTEP_LOCAL_ROOT
|
|
|
|
GNUSTEP_SYSTEM_ROOT
|
|
|
|
*/
|
|
|
|
pInfo = [NSProcessInfo processInfo];
|
|
|
|
env = [pInfo environment];
|
|
|
|
user = [[[env objectForKey: @"GNUSTEP_USER_ROOT"]
|
|
|
|
mutableCopy] autorelease];
|
|
|
|
[user appendString: @"/Libraries"];
|
|
|
|
local = [[[env objectForKey: @"GNUSTEP_LOCAL_ROOT"]
|
|
|
|
mutableCopy] autorelease];
|
|
|
|
[local appendString: @"/Libraries"];
|
|
|
|
system = [[[env objectForKey: @"GNUSTEP_SYSTEM_ROOT"]
|
|
|
|
mutableCopy] autorelease];
|
|
|
|
[system appendString: @"/Libraries"];
|
|
|
|
|
|
|
|
if (user)
|
|
|
|
user_bundle = [NSBundle bundleWithPath: user];
|
|
|
|
if (local)
|
|
|
|
local_bundle = [NSBundle bundleWithPath: local];
|
|
|
|
if (system)
|
|
|
|
system_bundle = [NSBundle bundleWithPath: system];
|
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
|
|
|
|
|
|
|
/* Gather up the paths */
|
|
|
|
/* Search user first */
|
|
|
|
user_path = [user_bundle pathForResource:setname
|
|
|
|
ofType:@"dat"
|
|
|
|
inDirectory:NSCharacterSet_PATH];
|
|
|
|
/* Search local second */
|
|
|
|
local_path = [local_bundle pathForResource:setname
|
|
|
|
ofType:@"dat"
|
|
|
|
inDirectory:NSCharacterSet_PATH];
|
|
|
|
/* Search system last */
|
|
|
|
system_path = [system_bundle pathForResource:setname
|
|
|
|
ofType:@"dat"
|
|
|
|
inDirectory:NSCharacterSet_PATH];
|
|
|
|
|
|
|
|
/* Try to load the set from the user path */
|
|
|
|
set = nil;
|
|
|
|
if (user_path != nil && [user_path length] != 0)
|
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
/* Load the character set file */
|
|
|
|
set = [self characterSetWithBitmapRepresentation:
|
|
|
|
[NSData dataWithContentsOfFile: user_path]];
|
|
|
|
NS_HANDLER
|
|
|
|
NSLog(@"Unable to read NSCharacterSet file %s",
|
|
|
|
[user_path cString]);
|
|
|
|
set = nil;
|
|
|
|
NS_ENDHANDLER
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we don't have a set yet then check local path */
|
|
|
|
if (set == nil && local_path != nil && [local_path length] != 0)
|
|
|
|
{
|
|
|
|
NS_DURING
|
|
|
|
/* Load the character set file */
|
|
|
|
set = [self characterSetWithBitmapRepresentation:
|
|
|
|
[NSData dataWithContentsOfFile: local_path]];
|
|
|
|
NS_HANDLER
|
|
|
|
NSLog(@"Unable to read NSCharacterSet file %s",
|
|
|
|
[local_path cString]);
|
|
|
|
set = nil;
|
|
|
|
NS_ENDHANDLER
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Lastly if we don't have a set yet then check system path */
|
|
|
|
if (set == nil && system_path != nil && [system_path length] != 0)
|
1997-05-03 17:16:10 +00:00
|
|
|
{
|
1997-10-16 23:56:27 +00:00
|
|
|
NS_DURING
|
|
|
|
/* Load the character set file */
|
|
|
|
set = [self characterSetWithBitmapRepresentation:
|
|
|
|
[NSData dataWithContentsOfFile: system_path]];
|
|
|
|
NS_HANDLER
|
|
|
|
NSLog(@"Unable to read NSCharacterSet file %s",
|
|
|
|
[system_path cString]);
|
|
|
|
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
|
|
|
{
|
|
|
|
[NSException raise:NSGenericException
|
1997-10-16 23:56:27 +00:00
|
|
|
format:@"Could not find bitmap file %s",
|
|
|
|
[setname cString]];
|
1996-09-02 13:53:26 +00:00
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
1997-10-16 23:56:27 +00:00
|
|
|
else
|
|
|
|
/* Else cache the set */
|
|
|
|
cache_set[number] = [set retain];
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
+ (NSCharacterSet *)alphanumericCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"alphanumCharSet" number: 0];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)controlCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"controlCharSet" number: 1];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)decimalDigitCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"decimalCharSet" number: 2];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)decomposableCharacterSet
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
fprintf(stderr, "Warning: Decomposable set not yet fully specified\n");
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"decomposableCharSet" number: 3];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)illegalCharacterSet
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
fprintf(stderr, "Warning: Illegal set not yet fully specified\n");
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"illegalCharSet" number: 4];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)letterCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"lettercharCharSet" number: 5];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)lowercaseLetterCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"lowercaseCharSet" number: 6];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)nonBaseCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"nonbaseCharSet" number: 7];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)uppercaseLetterCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"uppercaseCharSet" number: 8];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)whitespaceAndNewlineCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"whitespaceandnlCharSet" number: 9];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)whitespaceCharacterSet
|
|
|
|
{
|
1996-09-02 13:53:26 +00:00
|
|
|
return [self _bitmapForSet:@"whitespaceCharSet" number: 10];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Creating custom character sets
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)characterSetWithBitmapRepresentation:(NSData *)data
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
return [[[NSBitmapCharSet alloc] initWithBitmap:data] autorelease];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)characterSetWithCharactersInString:(NSString *)aString
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
int i, length;
|
|
|
|
char *bytes;
|
|
|
|
NSMutableData *bitmap = [NSMutableData dataWithLength:BITMAP_SIZE];
|
|
|
|
|
|
|
|
if (!aString)
|
|
|
|
{
|
|
|
|
[NSException raise:NSInvalidArgumentException
|
|
|
|
format:@"Creating character set with nil string"];
|
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
length = [aString length];
|
|
|
|
bytes = [bitmap mutableBytes];
|
|
|
|
for (i=0; i < length; i++)
|
|
|
|
{
|
|
|
|
unichar letter = [aString characterAtIndex:i];
|
|
|
|
SETBIT(bytes[letter/8], letter % 8);
|
|
|
|
}
|
|
|
|
|
|
|
|
return [self characterSetWithBitmapRepresentation:bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSCharacterSet *)characterSetWithRange:(NSRange)aRange
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
int i;
|
|
|
|
char *bytes;
|
|
|
|
NSMutableData *bitmap = [NSMutableData dataWithLength:BITMAP_SIZE];
|
|
|
|
|
|
|
|
if (NSMaxRange(aRange) > UNICODE_SIZE)
|
|
|
|
{
|
|
|
|
[NSException raise:NSInvalidArgumentException
|
|
|
|
format:@"Specified range exceeds character set"];
|
|
|
|
/* NOT REACHED */
|
|
|
|
}
|
|
|
|
|
|
|
|
bytes = (char *)[bitmap mutableBytes];
|
|
|
|
for (i=aRange.location; i < NSMaxRange(aRange); i++)
|
|
|
|
SETBIT(bytes[i/8], i % 8);
|
|
|
|
|
|
|
|
return [self characterSetWithBitmapRepresentation:bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
1998-11-10 20:16:33 +00:00
|
|
|
+ (NSCharacterSet *)characterSetWithContentsOfFile: (NSString *)aFile
|
|
|
|
{
|
|
|
|
if ([@"bitmap" isEqual: [aFile pathExtension]])
|
|
|
|
{
|
|
|
|
NSData *bitmap = [NSData dataWithContentsOfFile: aFile];
|
|
|
|
return [self characterSetWithBitmapRepresentation: bitmap];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
- (NSData *)bitmapRepresentation
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)characterIsMember:(unichar)aCharacter
|
|
|
|
{
|
1995-08-30 21:31:29 +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
|
|
|
|
{
|
|
|
|
[self subclassResponsibility:_cmd];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithCoder: (NSCoder*)aCoder
|
|
|
|
{
|
|
|
|
[self subclassResponsibility:_cmd];
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
1998-07-29 14:46:16 +00:00
|
|
|
- (BOOL) isEqual: (id)anObject
|
|
|
|
{
|
|
|
|
if (anObject == self)
|
|
|
|
return YES;
|
|
|
|
if ([anObject isKindOfClass:[NSCharacterSet class]])
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i <= 0xffff; i++)
|
|
|
|
if ([self characterIsMember: (unichar)i] !=
|
|
|
|
[anObject characterIsMember: (unichar)i])
|
|
|
|
return NO;
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
- (NSCharacterSet *)invertedSet
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
int i, length;
|
|
|
|
char *bytes;
|
1997-11-12 15:37:27 +00:00
|
|
|
NSMutableData *bitmap;
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1997-11-12 15:37:27 +00:00
|
|
|
bitmap = [[[self bitmapRepresentation] mutableCopy] autorelease];
|
1995-08-30 21:31:29 +00:00
|
|
|
length = [bitmap length];
|
|
|
|
bytes = [bitmap mutableBytes];
|
|
|
|
for (i=0; i < length; i++)
|
|
|
|
bytes[i] = ~bytes[i];
|
1995-05-05 21:03:04 +00:00
|
|
|
|
1995-08-30 21:31:29 +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
|
1995-05-05 21:03:04 +00:00
|
|
|
- (id)copyWithZone:(NSZone *)zone
|
|
|
|
{
|
|
|
|
if (NSShouldRetainWithZone(self, zone))
|
|
|
|
return [self retain];
|
|
|
|
else
|
1998-07-15 12:46:46 +00:00
|
|
|
return NSCopyObject (self, 0, zone);
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)mutableCopyWithZone:(NSZone *)zone
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
NSData *bitmap;
|
|
|
|
bitmap = [self bitmapRepresentation];
|
|
|
|
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 */
|
|
|
|
+ allocWithZone:(NSZone *)zone
|
|
|
|
{
|
|
|
|
return NSAllocateObject([NSMutableBitmapCharSet self], 0, zone);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Override this from NSCharacterSet to create the correct class */
|
|
|
|
+ (NSCharacterSet *)characterSetWithBitmapRepresentation:(NSData *)data
|
|
|
|
{
|
|
|
|
return [[[NSMutableBitmapCharSet alloc] initWithBitmap:data] autorelease];
|
|
|
|
}
|
|
|
|
|
1995-05-05 21:03:04 +00:00
|
|
|
/* Mutable subclasses must implement ALL of these methods. */
|
|
|
|
- (void)addCharactersInRange:(NSRange)aRange
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)addCharactersInString:(NSString *)aString
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)formUnionWithCharacterSet:(NSCharacterSet *)otherSet
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)formIntersectionWithCharacterSet:(NSCharacterSet *)otherSet
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)removeCharactersInRange:(NSRange)aRange
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)removeCharactersInString:(NSString *)aString
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)invert
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
[self subclassResponsibility:_cmd];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NSCopying, NSMutableCopying
|
|
|
|
- (id)copyWithZone:(NSZone *)zone
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
NSData *bitmap;
|
|
|
|
bitmap = [self bitmapRepresentation];
|
|
|
|
return [[NSBitmapCharSet allocWithZone:zone] initWithBitmap:bitmap];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)mutableCopyWithZone:(NSZone *)zone
|
|
|
|
{
|
1995-08-30 21:31:29 +00:00
|
|
|
return [super mutableCopyWithZone:zone];
|
1995-05-05 21:03:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|