EDStringScanner


Inherits From:
NSObject
Declared In:
EDStringScanner.h


Class Description

This is a fairly simple scanner that allows little more than retrieving individual characters from an NSString in a somewhat efficient way. The OmniFoundation has a much richer implementation but at the moment I am reluctant to use their's due to the licensing terms and dependency on OmniBase.


Global Variables

Synopsis:

unichar EDStringScannerEndOfDataCharacter;

Description:

Returned by getCharacter and peekCharacter when the scanner has reached the end of the string.


Instance Variables

NSString *string;
unichar *buffer;
unichar *charPointer;
unichar *endOfBuffer;
unsigned int bufferOffset;

stringAll instance variables are private.
buffer
charPointer
endOfBuffer
bufferOffset


Method Types

Creating string scanners
+ scannerWithString:
- initWithString:
Querying the scanner
- getCharacter
- peekCharacter
- scanLocation


Class Methods

scannerWithString:

+ (id)scannerWithString:(NSString *)aString

Creates and returns a scanner ready to scan aString.


Instance Methods

getCharacter

- (unichar)getCharacter

Returns the character at the current scan location and advances the latter. Returns EDStringScannerEndOfDataCharacter when the end of the string has been reached.


initWithString:

- (id)initWithString:(NSString *)aString

Initialises a newly allocated scanner to scan aString.


peekCharacter

- (unichar)peekCharacter

Returns the character at the current scan location. Returns EDStringScannerEndOfDataCharacter when the end of the string has been reached.


scanLocation

- (unsigned int)scanLocation

Returns the current scan location.


Version 2.0 Copyright ©2002. All Rights Reserved.