Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

JDCSVStringDictionaryFactory Class Reference

#import <JDCSVStringDictionaryFactory.h>

Inheritance diagram for JDCSVStringDictionaryFactory:

< JDCSVParserDelegate > List of all members.

Public Member Functions

(id) - initWithDataSetArray:
(NSArray *) - recordKeys

Detailed Description

Jeff Disher
A simple implementation of the JDCSVParserDelegate concrete protocol designed to demonstrate how a basic factory could be implemented to hook the output of the parser and compose it into a useful form. It reads the CSV file into a user-provided mutable array as NSDictionary objects representing each record in the file. The record fields are resolved using the column names as keys. Note that the resultant data is sparse in so much as empty fields are not created so not ever dictionary will have all the keys which describe the data set.

Member Function Documentation

- (id) initWithDataSetArray: (NSMutableArray *)  dataSet  

the designated initializer for this factory class

dataSet The mutable array which will be populated with dictionaries representing the records int he incoming stream
A newly initialized dictionary factory Creates a dictionary factory backed by the given dataSet. Once the parser operation is complete, the records found will be placed in dataSet.

- (NSArray *) recordKeys  

The array of keys (pulled from the CSV columns) which represent the superset of all keys present in the records read from the CSV file
Note that this will be empty if the parse has not yet occurred.

The documentation for this class was generated from the following file:
Generated on Sun Jun 10 16:41:27 2012 for JDCSVParser by  doxygen 1.4.3