Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.0.1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 47 lines (40 sloc) 1.054 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
//
// TDReader.h
// TDParseKit
//
// Created by Todd Ditchendorf on 1/21/06.
// Copyright 2008 Todd Ditchendorf. All rights reserved.
//

#import <Foundation/Foundation.h>

/*!
@class TDReader
@brief A character-stream reader that allows characters to be pushed back into the stream.
*/
@interface TDReader : NSObject {
    NSString *string;
    NSUInteger cursor;
    NSUInteger length;
}

/*!
@brief Designated Initializer. Initializes a reader with a given string.
@details Designated Initializer.
@param s string from which to read
@result an initialized reader
*/
- (id)initWithString:(NSString *)s;

/*!
@brief Read a single character
@result The character read, or -1 if the end of the stream has been reached
*/
- (NSInteger)read;

/*!
@brief Push back a single character
@details moves the cursor back one position
*/
- (void)unread;

/*!
@property string
@brief This reader's string.
*/
@property (nonatomic, retain) NSString *string;
@end
Something went wrong with that request. Please try again.