// // JSRunXmlParser.h // JSRun Import Framework // // Created by Jonathan on 8/29/06. // Copyright 2006 Jonathan Saggau. All rights reserved. #import @class JSRunModel, JSRunGoal, JSRunEvent; @interface JSRunXmlParser : NSObject { NSXMLParser *parser; NSURL *url; JSRunModel *run; // see http://developer.apple.com/documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html NSDictionary *currentAttributes; // here is where attributes dictionaries get dropped NSString * nextString; // here is where string data gets appended BOOL inGoalTag; // are we in a "goal" tag? BOOL inSnapshotTag; // are we in a "snapshot" tag? BOOL inSummaryTag; // are we getting the run summary? BOOL inKmSplit; BOOL inMiSplit; NSMutableString *currentStringValue; JSRunGoal *currentGoal; // this is where we dump while in a goal tag JSRunEvent *currentRunEvent; // this is where we dump while in a snapshot tag } - (id)initWithContentsOfURL:(NSURL *)url; - (void)parse; #pragma mark - #pragma mark accessors - (NSURL *)url; - (void)setUrl:(NSURL *)anUrl; - (JSRunModel *)run; - (void)setRun:(JSRunModel *)aRun; - (NSDictionary *)currentAttributes; - (void)setCurrentAttributes:(NSDictionary *)acurrentAttributes; - (NSString *)nextString; - (void)setNextString:(NSString *)aNextString; - (BOOL)inGoalTag; - (void)setInGoalTag:(BOOL)flag; - (BOOL)inSnapshotTag; - (void)setInSnapshotTag:(BOOL)flag; - (BOOL)inSummaryTag; - (void)setInSummaryTag:(BOOL)flag; - (BOOL)inKmSplit; - (void)setInKmSplit:(BOOL)flag; - (BOOL)inMiSplit; - (void)setInMiSplit:(BOOL)flag; - (JSRunGoal *)currentGoal; - (void)setCurrentGoal:(JSRunGoal *)aCurrentGoal; - (JSRunEvent *)currentRunEvent; - (void)setCurrentRunEvent:(JSRunEvent *)aCurrentRunEvent; @end