Up

NSCharacterSet class reference

Authors

Adam Fedor (fedor@boulder.colorado.edu)
Richard Frith-Macdonald (rfm@gnu.org)

Version: 35692

Date: 2012-10-15 15:37:31 +0100 (Mon, 15 Oct 2012)

Copyright: (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSCharacterSet class
  2. Software documentation for the NSMutableCharacterSet class

Software documentation for the NSCharacterSet class

NSCharacterSet : NSObject

Declared in:
Foundation/NSCharacterSet.h
Conforms to:
NSCoding
NSCopying
NSMutableCopying
Availability: OpenStep

Represents a set of unicode characters. Used by NSScanner and NSString for parsing-related methods.
Method summary

alphanumericCharacterSet 

+ (id) alphanumericCharacterSet;
Availability: OpenStep

Returns a character set containing letters, numbers, and diacritical marks. Note that "letters" includes all alphabetic as well as Chinese characters, etc..

capitalizedLetterCharacterSet 

+ (id) capitalizedLetterCharacterSet;
Availability: MacOS-X 10.0.0

Returns a character set containing letters in the unicode Titlecase category.

characterSetWithBitmapRepresentation: 

+ (id) characterSetWithBitmapRepresentation: (NSData*)data;
Availability: OpenStep

Returns a character set containing characters as encoded in the data object (8192 bytes)

characterSetWithCharactersInString: 

+ (id) characterSetWithCharactersInString: (NSString*)aString;
Availability: OpenStep

Returns set with characters in aString, or empty set for empty string. Raises an exception if given a nil string.

characterSetWithContentsOfFile: 

+ (id) characterSetWithContentsOfFile: (NSString*)aFile;
Availability: OPENSTEP 4.0.0 removed at MacOS-X 10.0.0

Initializes from a bitmap (8192 bytes representing 65536 values).
Each bit set in the bitmap represents the fact that a character at that position in the unicode base plane exists in the characterset.
File must have extension " .bitmap ". To get around this load the file into data yourself and use [NSCharacterSet -characterSetWithBitmapRepresentation].

characterSetWithRange: 

+ (id) characterSetWithRange: (NSRange)aRange;
Availability: OpenStep

Returns set containing unicode index range given by aRange.

controlCharacterSet 

+ (id) controlCharacterSet;
Availability: OpenStep

Returns a character set containing control and format characters.

decimalDigitCharacterSet 

+ (id) decimalDigitCharacterSet;
Availability: OpenStep

Returns a character set containing characters that represent the decimal digits 0 through 9.

decomposableCharacterSet 

+ (id) decomposableCharacterSet;
Availability: OpenStep

Returns a character set containing individual characters that can be represented also by a composed character sequence.

illegalCharacterSet 

+ (id) illegalCharacterSet;
Availability: OpenStep

Returns a character set containing unassigned and explicitly illegal character values.

letterCharacterSet 

+ (id) letterCharacterSet;
Availability: OpenStep

Returns a character set containing letters, including all alphabetic as well as Chinese characters, etc..

lowercaseLetterCharacterSet 

+ (id) lowercaseLetterCharacterSet;
Availability: OpenStep

Returns a character set that contains the lowercase characters. This set does not include caseless characters, only those that have corresponding characters in uppercase and/or titlecase.

newlineCharacterSet 

+ (id) newlineCharacterSet;
Availability: MacOS-X 10.0.0

Returns a character set containing the newline characters, values 0x000A and 0x000D and nextline 0x0085 character.

nonBaseCharacterSet 

+ (id) nonBaseCharacterSet;
Availability: OpenStep

Returns a character set containing characters for diacritical marks, which are usually only rendered in conjunction with another character.

punctuationCharacterSet 

+ (id) punctuationCharacterSet;
Availability: OpenStep

Returns a character set containing punctuation marks.

symbolCharacterSet 

+ (id) symbolCharacterSet;
Availability: MacOS-X 10.0.0

Returns a character set containing mathematical symbols, etc..

uppercaseLetterCharacterSet 

+ (id) uppercaseLetterCharacterSet;
Availability: OpenStep

Returns a character set that contains the uppercase characters. This set does not include caseless characters, only those that have corresponding characters in lowercase and/or titlecase.

whitespaceAndNewlineCharacterSet 

+ (id) whitespaceAndNewlineCharacterSet;
Availability: OpenStep

Returns a character set that contains the whitespace characters, plus the newline characters, values 0x000A and 0x000D and nextline 0x0085 character.

whitespaceCharacterSet 

+ (id) whitespaceCharacterSet;
Availability: OpenStep

Returns a character set that contains the whitespace characters.

bitmapRepresentation 

- (NSData*) bitmapRepresentation;
Availability: OpenStep

Returns a bitmap representation of the receiver's character set (suitable for archiving or writing to a file), in an NSData object.

characterIsMember: 

- (BOOL) characterIsMember: (unichar)aCharacter;
Availability: OpenStep

Returns YES if the receiver contains aCharacter, NO if it does not.

hasMemberInPlane: 

- (BOOL) hasMemberInPlane: (uint8_t)aPlane;
Availability: MacOS-X 10.0.0

Returns YES if the receiver contains at least one character in the specified unicode plane.

invertedSet 

- (NSCharacterSet*) invertedSet;
Availability: OpenStep

Returns a character set containing only characters that the receiver does not contain.

isSupersetOfSet: 

- (BOOL) isSupersetOfSet: (NSCharacterSet*)aSet;
Availability: MacOS-X 10.0.0

Returns YES is all the characters in aSet are present in the receiver.

longCharacterIsMember: 

- (BOOL) longCharacterIsMember: (UTF32Char)aCharacter;
Availability: MacOS-X 10.0.0

Returns YES is the specified 32-bit character is present in the receiver.

Software documentation for the NSMutableCharacterSet class

NSMutableCharacterSet : NSCharacterSet

Declared in:
Foundation/NSCharacterSet.h
Availability: OpenStep

An NSCharacterSet that can be modified.
Method summary

addCharactersInRange: 

- (void) addCharactersInRange: (NSRange)aRange;
Availability: OpenStep

Adds characters specified by unicode indices in aRange to set.

addCharactersInString: 

- (void) addCharactersInString: (NSString*)aString;
Availability: OpenStep

Adds characters in aString to set.

formIntersectionWithCharacterSet: 

- (void) formIntersectionWithCharacterSet: (NSCharacterSet*)otherSet;
Availability: OpenStep

Set intersection of character sets.

formUnionWithCharacterSet: 

- (void) formUnionWithCharacterSet: (NSCharacterSet*)otherSet;
Availability: OpenStep

Set union of character sets.

invert 

- (void) invert;
Availability: OpenStep

Remove all characters currently in set and add all other characters.

removeCharactersInRange: 

- (void) removeCharactersInRange: (NSRange)aRange;
Availability: OpenStep

Drop given range of characters. No error for characters not currently in set.

removeCharactersInString: 

- (void) removeCharactersInString: (NSString*)aString;
Availability: OpenStep

Drop characters in aString. No error for characters not currently in set.


Up