Skip to content
Newer
Older
100644 37 lines (29 sloc) 635 Bytes
4deff4d Initial check-in.
uli authored
1 //
2 // NSScanner+SkipUpToCharset.m
3 // UKSyntaxColoredDocument
4 //
5 // Created by Uli Kusterer on Sat Dec 13 2003.
6 // Copyright (c) 2003 M. Uli Kusterer. All rights reserved.
7 //
8
9 #import "NSScanner+SkipUpToCharset.h"
10
11
ff40e74 @uliwitness Changed license, corrected category name.
authored
12 @implementation NSScanner (UKSkipUpToCharset)
4deff4d Initial check-in.
uli authored
13
14 -(BOOL) skipUpToCharactersFromSet:(NSCharacterSet*)set
15 {
16 NSString* vString = [self string];
5e83360 @uliwitness Shut up some warnings.
authored
17 NSUInteger x = [self scanLocation];
4deff4d Initial check-in.
uli authored
18
19 while( x < [vString length] )
20 {
21 if( ![set characterIsMember: [vString characterAtIndex: x]] )
22 x++;
23 else
24 break;
25 }
26
27 if( x > [self scanLocation] )
28 {
29 [self setScanLocation: x];
30 return YES;
31 }
32 else
33 return NO;
34 }
35
36 @end
Something went wrong with that request. Please try again.