ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/FoundationKit/Classes/NSScanner.rtf

This is NSScanner.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSScanner 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCopying
fi0 NSObject (NSObject)
fs20 
fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSScanner.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 The NSScanner class declares the programmatic interface to an object that is capable of scanning NSString objects (strings of characters in the UniCode character encoding), converting the scanned strings to various numeric representations, or scanning characters from a character set.
fs16 
fs28 Generally, you instantiate a scanner object by sending one of b scannerWithStringb0 : orb  localizedScannerWithStringb0 : methods to the NSScanner class object. Either method returns a scanner object initialized with the string you pass in.
fs16 
fs28 NSScanner provides methods of configuring the behavior of the scan.b  setCaseSensitive:b0  specifies whether the scanner will treat upper case and lower case letters as distinct.b  setCharactersToBeSkipped:b0  determines the set of characters that will be skipped while scanning. The preset set of characters to skip are whitespace and newline characters.b  setLocale:b0  specifies the locale to be used while scanning stringsb . setScanLocation:b0  sets the index in the string object at that scanning will commence. Using this method, you can repeatedly scan portions of a string.
fs16 
fs28 Scanning is performed using any of the b scanb0 'bc methods listed under 'aaScanning a String'ba. 
fs16 
fs28 Note that floating point numbers are assumed to be IEEE compliant.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Creating an NSScanner
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (id)b localizedScannerWithString:b0 (NSString *)i aString
s9 li7030 fi-6553 fi-5796 i0 tab Creates and returns a scanner that scans i aStringi0 . Invokes b initWithString:b0  and sets the locale to the user'27s default locale.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (id)b scannerWithString:b0 (NSString *)i aStringi0 tab Creates and returns a scanner that scans i aStringi0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b initWithString:b0 (NSString *)i aStringi0 tab Initializes the receiver, a newly allocated scanner, to scan i aStringi0 . Returns b selfb0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting an NSScanner'27s String
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b stringb0 tab Returns the string object that the scanner was created with.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Configuring an NSScanner
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b caseSensitiveb0 tab Returns YES if the scanner distinguishes case, and NO otherwise. Scanners are by default i noti0  case sensitive.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSCharacterSet *)b charactersToBeSkippedb0 tab Returns a character set object containing those characters that the scanner ignores when looking for an element. The default set is the whitespace and newline character set.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSDictionary *)b localeb0 tab Returns a dictionary object containing locale information. Returns b nilb0  if the locale dictionary has not been set.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (unsigned)b scanLocationb0 tab Returns the character index at which the scanner will begin its next scanning operation.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setCaseSensitive:b0 (BOOL)i flagi0 tab If i flagi0  is YES, the scanner considers case when scanning characters. If i flagi0  is NO, it ignores case distinctions. NSScanners are by default i noti0  case sensitive.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setCharactersToBeSkipped:b0 (NSCharacterSet *)i aSet
s9 li7030 fi-6553 fi-5796 i0 tab Sets the scanner to ignore characters from i aSeti0  when scanning its string.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setLocale:b0 (NSDictionary *)i localeDictionaryi0 tab Sets the receiver'27s dictionary object containing locale information.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setScanLocation:b0 (unsigned int)i anIndexi0 tab Sets the location at which the next scan will begin to i anIndexi0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Scanning a String
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 In the b scanb0 'bcmethods listed here, the i valuei0  arguments (which are values returned by reference) are optional. Pass an argument value of b nilb0  if you do not wish a return value.
fs16 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 {f3 -} (BOOL)b scanCharactersFromSet:b0 (NSCharacterSet *)i aSeti0 tab 
s9 li7030 fi-6553 fi-5796 b intoString:b0 (NSString **)i valuei0 tab Scans the string as long as characters from i aSeti0  are encountered, accumulating characters into an optional string that'27s returned by reference in i valuei0 . If any characters are scanned, returns YES; otherwise returns NO.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanDouble:b0 (double *)i valuei0 tab Scans a b doubleb0  into i valuei0  if possible. Returns YES if a valid floating-point expression was scanned; NO otherwise. HUGE_VAL or {f3 -}HUGE_VAL is put in i valuei0  on overflow; 0.0 on underflow. Returns YES in overflow and underflow cases
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanFloat:b0 (float *)i valuei0 tab Scans a b floatb0  into i valuei0  if possible. Returns YES if a valid floating-point expression was scanned; NO otherwise. HUGE_VAL or {f3 -}HUGE_VAL is put in i valuei0  on overflow; 0.0 on underflow. Returns YES in overflow and underflow cases.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanInt:b0 (int *)i valuei0 tab Scans an b intb0  into i valuei0  if possible. Returns YES if a valid integer expression was scanned; NO otherwise. INT_MAX or INT_MIN is put in i valuei0  on overflow. Returns YES in overflow cases. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanLongLong:b0 (long long *)i valuei0 tab Scans a b long long intb0  into i valuei0  if possible. Returns YES if a valid integer expression was scanned; NO otherwise. LONG_LONG_MAX or LONG_LONG_MIN is put in i valuei0  on overflow. Returns YES in overflow cases. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanString:b0 (NSString *)i aStringi0 tab Scans for i aStringi0 , and if a match is found returns by
s9 li7030 fi-6553 fi-5796 b intoString:b0 (NSString **)i valuei0 tab  tab reference in the optional i valuei0  argument a string object equal to it. If i aStringi0  matches the characters at the scan location, returns YES; otherwise returns NO.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanUpToCharactersFromSet:b0 (NSCharacterSet *)i aSeti0 tab 
s9 li7030 fi-6553 fi-5796 b intoString:b0 (NSString **)i valuei0 tab Scans the string until a character from i aSeti0  is encountered, accumulating characters encountered into a string that'27s returned by reference in the optional i valuei0  argument. If any characters are scanned, returns YES; otherwise returns NO.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b scanUpToString:b0 (NSString *)i aStringi0 tab Scans the string until i aStringi0  is encountered,
s9 li7030 fi-6553 fi-5796 b intoString:b0 (NSString **)i valuei0 tab  tab accumulating characters encountered into a string that'27s returned by reference in the optional i valuei0  argument. If any characters are scanned, returns YES; otherwise returns NO.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isAtEndb0 tab Returns YES if the scanner has exhausted all characters in its string; NO if there are characters left to scan.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.