Platforms to show: All Mac Windows Linux Cross-Platform
NSCharacterSetMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSString and NSScanner objects use NSCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. The cluster's two public classes, NSCharacterSet and NSMutableCharacterSet, declare the programmatic interface for static and dynamic character sets, respectively.
The objects you create using these classes are referred to as character set objects (and when no confusion will result, merely as character sets). Because of the nature of class clusters, character set objects aren't actual instances of the NSCharacterSet or NSMutableCharacterSet classes but of one of their private subclasses. Although a character set object's class is private, its interface is public, as declared by these abstract superclasses, NSCharacterSet and NSMutableCharacterSet. The character set classes adopt the NSCopying and NSMutableCopying protocols, making it convenient to convert a character set of one type to the other.
The NSCharacterSet class declares the programmatic interface for an object that manages a set of Unicode characters (see the NSString class cluster specification for information on Unicode). NSCharacterSet's principal primitive method, characterIsMember:, provides the basis for all other instance methods in its interface. A subclass of NSCharacterSet needs only to implement this method, plus mutableCopyWithZone:, for proper behavior. For optimal performance, a subclass should also override bitmapRepresentation, which otherwise works by invoking characterIsMember: for every possible Unicode value.
NSCharacterSet is "toll-free bridged" with its Cocoa Foundation counterpart, CFCharacterSet Reference. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSCharacterSet * parameter, you can pass a CFCharacterSetRef, and in a function where you see a CFCharacterSetRef parameter, you can pass an NSCharacterSet instance (you cast one type to the other to suppress compiler warnings). See Interchangeable Data Types for more information on toll-free bridging.
The mutable subclass of NSCharacterSet is NSMutableCharacterSet.
- 3 properties
- property CharacterCount as Integer
- property Handle as Integer
- property StringValue as string
- 13 methods
- method bitmapRepresentation as MemoryBlock
- method characterIsMember(Character as Integer) as boolean
- method componentsSeparatedByCharactersInSet(s as string) as String()
- method Constructor
- method copy as NSCharacterSetMBS
- method hasMemberInPlane(thePlane as Integer) as boolean
- method invertedSet as NSCharacterSetMBS
- method isSupersetOfSet(theOtherSet as NSCharacterSetMBS) as boolean
- method longCharacterIsMember(theLongChar as Integer) as boolean
- method mutableCopy as NSMutableCharacterSetMBS
- method Operator_Convert as string
- method rangeOfCharacterFromSet(s as string, options as Integer = 0, searchRange as NSRangeMBS = nil) as NSRangeMBS
- method stringByTrimmingCharactersInSet(s as string) as String
- 20 shared methods
- shared method alphanumericCharacterSet as NSCharacterSetMBS
- shared method capitalizedLetterCharacterSet as NSCharacterSetMBS
- shared method characterSetWithBitmapRepresentation(data as MemoryBlock) as NSCharacterSetMBS
- shared method characterSetWithCharactersInString(aString as string) as NSCharacterSetMBS
- shared method characterSetWithContentsOfFile(aString as string) as NSCharacterSetMBS
- shared method characterSetWithContentsOfFile(file as folderitem) as NSCharacterSetMBS
- shared method characterSetWithRange(r as NSRangeMBS) as NSCharacterSetMBS
- shared method controlCharacterSet as NSCharacterSetMBS
- shared method decimalDigitCharacterSet as NSCharacterSetMBS
- shared method decomposableCharacterSet as NSCharacterSetMBS
- shared method illegalCharacterSet as NSCharacterSetMBS
- shared method letterCharacterSet as NSCharacterSetMBS
- shared method lowercaseLetterCharacterSet as NSCharacterSetMBS
- shared method newlineCharacterSet as NSCharacterSetMBS
- shared method nonBaseCharacterSet as NSCharacterSetMBS
- shared method punctuationCharacterSet as NSCharacterSetMBS
- shared method symbolCharacterSet as NSCharacterSetMBS
- shared method uppercaseLetterCharacterSet as NSCharacterSetMBS
- shared method whitespaceAndNewlineCharacterSet as NSCharacterSetMBS
- shared method whitespaceCharacterSet as NSCharacterSetMBS
Constants
Constant | Value | Description |
---|---|---|
NSOpenStepUnicodeReservedBase | &hF400 |
A constant to specify lower bound for a Unicode character range reserved for Apple's corporate use.
Specifies lower bound for a Unicode character range reserved for Apple's corporate use (the range is 0xF400–0xF8FF). |
Sub classes:
Some methods using this class:
- NSTokenFieldMBS.defaultTokenizingCharacterSet as NSCharacterSetMBS
Some properties using for this class:
- NSTokenFieldMBS.tokenizingCharacterSet as NSCharacterSetMBS
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.1
- MBS Xojo Plugins, version 24.1pr5
- MBS Xojo / Real Studio Plugins, version 15.1pr7
- Nearly 2000 new Functions in the 9.6 prerelease of MBS
Xojo Developer Magazine
Release notes
- Version 24.1
- Added CharacterCount property for NSCharacterSetMBS class for debugging.
- Changed StringValue in NSCharacterSetMBS class to property, so we see it in the debugger.
The items on this page are in the following plugins: MBS MacBase Plugin.