Up

NSCharacterSet class reference

Authors

Adam Fedor (fedor@boulder.colorado.edu)

Version: 1.48

Date: 2005/02/22 11:22:43

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
Standards:

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

Method summary

alphanumericCharacterSet 

+ (NSCharacterSet*) alphanumericCharacterSet;

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


characterSetWithBitmapRepresentation: 

+ (NSCharacterSet*) characterSetWithBitmapRepresentation: (NSData*)data;

Returns a character set containing characters as encoded in the data object.


characterSetWithCharactersInString: 

+ (NSCharacterSet*) characterSetWithCharactersInString: (NSString*)aString;

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


characterSetWithContentsOfFile: 

+ (NSCharacterSet*) characterSetWithContentsOfFile: (NSString*)aFile;

Initializes from a bitmap. (See NSBitmapCharSet .) File must have extension " .bitmap ". (To get around this load the file into data yourself and use [NSCharacterSet -characterSetWithBitmapRepresentation].


characterSetWithRange: 

+ (NSCharacterSet*) characterSetWithRange: (NSRange)aRange;

Returns set containing unicode index range given by aRange.


controlCharacterSet 

+ (NSCharacterSet*) controlCharacterSet;

Returns a character set containing control and format characters.


decimalDigitCharacterSet 

+ (NSCharacterSet*) decimalDigitCharacterSet;

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


decomposableCharacterSet 

+ (NSCharacterSet*) decomposableCharacterSet;

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


illegalCharacterSet 

+ (NSCharacterSet*) illegalCharacterSet;

Returns a character set containing unassigned (illegal) character values.


letterCharacterSet 

+ (NSCharacterSet*) letterCharacterSet;

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


lowercaseLetterCharacterSet 

+ (NSCharacterSet*) lowercaseLetterCharacterSet;

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.


nonBaseCharacterSet 

+ (NSCharacterSet*) nonBaseCharacterSet;

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


punctuationCharacterSet 

+ (NSCharacterSet*) punctuationCharacterSet;

Returns a character set containing punctuation marks.


symbolAndOperatorCharacterSet 

+ (NSCharacterSet*) symbolAndOperatorCharacterSet;

Returns a character set containing mathematical symbols, etc..


uppercaseLetterCharacterSet 

+ (NSCharacterSet*) uppercaseLetterCharacterSet;

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 

+ (NSCharacterSet*) whitespaceAndNewlineCharacterSet;

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


whitespaceCharacterSet 

+ (NSCharacterSet*) whitespaceCharacterSet;

Returns a character set that contains the whitespace characters.


bitmapRepresentation 

- (NSData*) bitmapRepresentation;

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;

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


invertedSet 

- (NSCharacterSet*) invertedSet;

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


Software documentation for the NSMutableCharacterSet class

NSMutableCharacterSet : NSCharacterSet

Declared in:
Foundation/NSCharacterSet.h
Standards:

An NSCharacterSet that can be modified.

Method summary

addCharactersInRange: 

- (void) addCharactersInRange: (NSRange)aRange;

Adds characters specified by unicode indices in aRange to set.


addCharactersInString: 

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

Adds characters in aString to set.


formIntersectionWithCharacterSet: 

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

Set intersection of character sets.


formUnionWithCharacterSet: 

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

Set union of character sets.


invert 

- (void) invert;

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


removeCharactersInRange: 

- (void) removeCharactersInRange: (NSRange)aRange;

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


removeCharactersInString: 

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

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



Up