4 Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
7 Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
9 This file is part of libFoundation.
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted, provided
13 that the above copyright notice appear in all copies and that both that
14 copyright notice and this permission notice appear in supporting
17 We disclaim all warranties with regard to this software, including all
18 implied warranties of merchantability and fitness, in no event shall
19 we be liable for any special, indirect or consequential damages or any
20 damages whatsoever resulting from loss of use, data or profits, whether in
21 an action of contract, negligence or other tortious action, arising out of
22 or in connection with the use or performance of this software.
25 #ifndef __NSScanner_h__
26 #define __NSScanner_h__
31 #include <Foundation/NSObject.h>
34 # define LONG_LONG_MAX (((unsigned long long)-1) >> 1)
38 # define LONG_LONG_MIN (-LONG_LONG_MAX - 1)
43 @class NSCharacterSet;
45 @interface NSScanner : NSObject
48 + (id)scannerWithString:(NSString*)string;
49 + (id)localizedScannerWithString:(NSString*)string;
50 - (id)initWithString:(NSString*)string;
52 /* Getting an NSScanner's string */
55 /* Configuring an NSScanner */
56 - (void)setScanLocation:(unsigned int)index;
57 - (unsigned int)scanLocation;
58 - (void)setCaseSensitive:(BOOL)flag;
59 - (BOOL)caseSensitive;
60 - (void)setCharactersToBeSkipped:(NSCharacterSet*)skipSet;
61 - (NSCharacterSet*)charactersToBeSkipped;
63 /* Setting and getting a locale */
64 - (void)setLocale:(NSDictionary*)locale;
65 - (NSDictionary*)locale;
67 /* Scanning a string */
68 - (BOOL)scanCharactersFromSet:(NSCharacterSet*)scanSet
69 intoString:(NSString**)value;
70 - (BOOL)scanUpToCharactersFromSet:(NSCharacterSet*)stopSet
71 intoString:(NSString **)value;
72 - (BOOL)scanDouble:(double*)value;
73 - (BOOL)scanFloat:(float*)value;
74 - (BOOL)scanInt:(int*)value;
75 - (BOOL)scanLongLong:(long long*)value;
76 - (BOOL)scanString:(NSString*)string intoString:(NSString**)value;
77 - (BOOL)scanUpToString:(NSString*)stopString intoString:(NSString**)value;
82 #endif /* __NSScanner_h__ */