forked from davedelong/CHCSVParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to parse a string. Added relevant unit tests and fi…
…xed atomic writing bug
- Loading branch information
1 parent
6866bdf
commit 7cba09d
Showing
13 changed files
with
299 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// CHCSV.h | ||
// CHCSVParser | ||
// | ||
// Created by Dave DeLong on 10/2/10. | ||
// Copyright 2010 Home. All rights reserved. | ||
// | ||
|
||
#import "CHCSVParser.h" | ||
#import "CHCSVWriter.h" | ||
#import "NSArray+CHCSVAdditions.h" | ||
#import "NSString+CHCSVAdditions.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// CHCSVSupport.h | ||
// CHCSVParser | ||
// | ||
// Created by Dave DeLong on 10/2/10. | ||
// Copyright 2010 Home. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "CHCSVParser.h" | ||
|
||
@interface NSArrayCHCSVAggregator : NSObject <CHCSVParserDelegate> { | ||
NSMutableArray * lines; | ||
NSMutableArray * currentLine; | ||
NSError * error; | ||
} | ||
|
||
@property (readonly) NSArray * lines; | ||
@property (readonly) NSError * error; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// CHCSVSupport.m | ||
// CHCSVParser | ||
// | ||
// Created by Dave DeLong on 10/2/10. | ||
// Copyright 2010 Home. All rights reserved. | ||
// | ||
|
||
#import "CHCSVSupport.h" | ||
|
||
|
||
@implementation NSArrayCHCSVAggregator | ||
@synthesize lines, error; | ||
|
||
- (void) dealloc { | ||
[lines release]; | ||
[currentLine release]; | ||
[error release]; | ||
[super dealloc]; | ||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didStartDocument:(NSString *)csvFile { | ||
lines = [[NSMutableArray alloc] init]; | ||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didStartLine:(NSUInteger)lineNumber { | ||
currentLine = [[NSMutableArray alloc] init]; | ||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didEndLine:(NSUInteger)lineNumber { | ||
[lines addObject:currentLine]; | ||
[currentLine release], currentLine = nil; | ||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didReadField:(NSString *)field { | ||
[currentLine addObject:field]; | ||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didEndDocument:(NSString *)csvFile { | ||
|
||
} | ||
|
||
- (void) parser:(CHCSVParser *)parser didFailWithError:(NSError *)anError { | ||
error = [anError retain]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.