X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/3874de1f6137ae56ee5161d54ccc262b71eef884..2a102862ea91854a43c87a7693e73c1323481e5d:/ITStringScanner.m?ds=sidebyside diff --git a/ITStringScanner.m b/ITStringScanner.m deleted file mode 100755 index 0e71ff7..0000000 --- a/ITStringScanner.m +++ /dev/null @@ -1,111 +0,0 @@ -// I *could* use OWStringScanner, but I don't want to. Shut up, sabi :) - -#import "ITStringScanner.h" - -@implementation ITStringScanner - -- (id)init -{ - if ( ( self = [super init] ) ) - { - _cString = NULL; - _string = nil; - _currentPosition = 0; - _size = 0; - } - return self; -} - -- (id)initWithString:(NSString*)string -{ - if ( ( self = [super init] ) ) - { - _cString = (char *)[string cString]; - _string = [string retain]; - _currentPosition = 0; - _size = [string length]; - } - return self; -} - -- (NSString *)scanUpToCharacter:(char)character -{ - size_t i=_currentPosition,j=0; - - if (_cString[i] == character) - { - i++; - return @""; - } - else - { - NSRange r = {i,0}; - NSString *tmpStr = nil; - const size_t tmp = _size; - unsigned char foundIt = NO; - - do - { - i++,j++; - - if (_cString[i] == character) - { - foundIt = YES; - r.length = j; - } - - } - while ((!foundIt) && (i