]> err.no Git - sope/blob - libFoundation/Foundation/NSScanner.h
fixed some NGMail framework build issue
[sope] / libFoundation / Foundation / NSScanner.h
1 /* 
2    NSScanner.h
3
4    Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
5    All rights reserved.
6
7    Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
8
9    This file is part of libFoundation.
10
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
15    documentation.
16
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.
23 */
24
25 #ifndef __NSScanner_h__
26 #define __NSScanner_h__
27
28 #include <limits.h>
29 #include <float.h>
30
31 #include <Foundation/NSObject.h>
32
33 #ifndef LONG_LONG_MAX
34 # define LONG_LONG_MAX  (((unsigned long long)-1) >> 1)
35 #endif
36
37 #ifndef LONG_LONG_MIN
38 # define LONG_LONG_MIN  (-LONG_LONG_MAX - 1)
39 #endif
40
41 @class NSString;
42 @class NSDictionary;
43 @class NSCharacterSet;
44
45 @interface NSScanner : NSObject
46
47 /* Creation */
48 + (id)scannerWithString:(NSString*)string;
49 + (id)localizedScannerWithString:(NSString*)string;
50 - (id)initWithString:(NSString*)string;
51
52 /* Getting an NSScanner's string */
53 - (NSString*)string;
54
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;
62
63 /* Setting and getting a locale */
64 - (void)setLocale:(NSDictionary*)locale;
65 - (NSDictionary*)locale;
66
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;
78 - (BOOL)isAtEnd;
79
80 @end
81
82 #endif /* __NSScanner_h__ */
83
84 /*
85   Local Variables:
86   c-basic-offset: 4
87   tab-width: 8
88   End:
89 */