diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4406a60 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Classes/lib/objective_support"] + path = Classes/lib/objective_support + url = git@github.com:yfactorial/objectivesupport.git diff --git a/Classes/lib/CoreSupport.h b/Classes/lib/CoreSupport.h deleted file mode 100644 index 243a6bc..0000000 --- a/Classes/lib/CoreSupport.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// CoreSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSString+GSub.h" -#import "NSString+InflectionSupport.h" -#import "NSObject+PropertySupport.h" \ No newline at end of file diff --git a/Classes/lib/FromXMLElementDelegate.h b/Classes/lib/FromXMLElementDelegate.h deleted file mode 100644 index d03cced..0000000 --- a/Classes/lib/FromXMLElementDelegate.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// FromXMLElementDelegate.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface FromXMLElementDelegate : NSObject { - Class targetClass; - id parsedObject; - NSString *currentPropertyName; - NSMutableString *contentOfCurrentProperty; - NSMutableArray *unclosedProperties; - NSString *currentPropertyType; -} - -@property (nonatomic, retain) Class targetClass; -@property (nonatomic, retain) id parsedObject; -@property (nonatomic, retain) NSString *currentPropertyName; -@property (nonatomic, retain) NSMutableString *contentOfCurrentProperty; -@property (nonatomic, retain) NSMutableArray *unclosedProperties; -@property (nonatomic, retain) NSString *currentPropertyType; - -+ (FromXMLElementDelegate *)delegateForClass:(Class)targetClass; - -- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict; -- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string; -- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName; -- (NSString *)convertElementName:(NSString *)anElementName; - -@end diff --git a/Classes/lib/FromXMLElementDelegate.m b/Classes/lib/FromXMLElementDelegate.m deleted file mode 100644 index cc7c57a..0000000 --- a/Classes/lib/FromXMLElementDelegate.m +++ /dev/null @@ -1,175 +0,0 @@ -// -// FromXMLElementDelegate.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "FromXMLElementDelegate.h" -#import "XMLSerializableSupport.h" -#import "CoreSupport.h" - -@implementation FromXMLElementDelegate - -@synthesize targetClass, parsedObject, currentPropertyName, contentOfCurrentProperty, unclosedProperties, currentPropertyType; - -+ (FromXMLElementDelegate *)delegateForClass:(Class)targetClass { - FromXMLElementDelegate *delegate = [[[self alloc] init] autorelease]; - [delegate setTargetClass:targetClass]; - return delegate; -} - - -- (id)init { - super; - self.unclosedProperties = [NSMutableArray array]; - return self; -} - - -- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict -{ - - if ([@"nil-classes" isEqualToString:elementName]) { - //empty result set, do nothing - } - - //Start of an array type - else if ([@"array" isEqualToString:[attributeDict objectForKey:@"type"]]) { - self.parsedObject = [NSMutableArray array]; - [self.unclosedProperties addObject:[NSArray arrayWithObjects:[elementName camelize], self.parsedObject, nil]]; - self.currentPropertyName = [elementName camelize]; - } - - //Start of the root object - else if (parsedObject == nil && [elementName isEqualToString:[self.targetClass xmlElementName]]) { - self.parsedObject = [[[self.targetClass alloc] init] autorelease]; - [self.unclosedProperties addObject:[NSArray arrayWithObjects:[elementName camelize], self.parsedObject, nil]]; - self.currentPropertyName = [elementName camelize]; - } - - else { - //if we are inside another element and it is not the current parent object, - // then create an object for that parent element - if(self.currentPropertyName != nil && (![self.currentPropertyName isEqualToString:[[self.parsedObject class] xmlElementName]])) { - Class elementClass = NSClassFromString([currentPropertyName toClassName]); - if (elementClass != nil) { - //classname matches, instantiate a new instance of the class and set it as the current parent object - self.parsedObject = [[[elementClass alloc] init] autorelease]; - [self.unclosedProperties addObject:[NSArray arrayWithObjects:self.currentPropertyName, self.parsedObject, nil]]; - } - } - - // If we recognize an element that corresponds to a known property of the current parent object, or if the - // current parent is an array then start collecting content for this child element - - - if (([self.parsedObject isKindOfClass:[NSArray class]]) || - ([[[self.parsedObject class] propertyNames] containsObject:[[self convertElementName:elementName] camelize]])) { - self.currentPropertyName = [[self convertElementName:elementName] camelize]; - self.contentOfCurrentProperty = [NSMutableString string]; - self.currentPropertyType = [attributeDict objectForKey:@"type"]; - } else { - // The element isn't one that we care about, so set the property that holds the - // character content of the current element to nil. That way, in the parser:foundCharacters: - // callback, the string that the parser reports will be ignored. - self.currentPropertyName = nil; - self.contentOfCurrentProperty = nil; - } - } -} - -// Characters (i.e. an element value - retarded, I know) are given to us in chunks, -// so we need to append them onto the current property value. -- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string -{ - - // If the current property is nil, then we know we're currently at - // an element that we don't know about or don't care about - if (self.contentOfCurrentProperty) { - - // Append string value on since we're given them in chunks - [self.contentOfCurrentProperty appendString:string]; - } -} - -//Basic type conversion based on the ObjectiveResource "type" attribute -- (id) convertProperty:(NSString *)propertyValue toType:(NSString *)type { - if ([type isEqualToString:@"datetime" ]) { - return [NSDate fromXMLDateTimeString:propertyValue]; - } - else if ([type isEqualToString:@"date"]) { - return [NSDate fromXMLDateString:propertyValue]; - } - else { - return [NSString fromXmlString:propertyValue]; - } -} - -// Converts the Id element to modelNameId -- (NSString *) convertElementName:(NSString *)anElementName { - - if([anElementName isEqualToString:@"id"]) { - - return [NSString stringWithFormat:@"%@_%@" , [NSStringFromClass([self.parsedObject class]) - stringByReplacingCharactersInRange:NSMakeRange(0, 1) - withString:[[NSStringFromClass([self.parsedObject class]) - substringWithRange:NSMakeRange(0,1)] - lowercaseString]], anElementName]; - } - else { - - return anElementName; - - } - -} - -// We're done receiving the value of a particular element, so take the value we've collected and -// set it on the current object -- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName -{ - if(self.contentOfCurrentProperty != nil && self.currentPropertyName != nil) { - [self.parsedObject - setValue:[self convertProperty:self.contentOfCurrentProperty toType:self.currentPropertyType] - forKey:self.currentPropertyName]; - } - else if ([self.currentPropertyName isEqualToString:[self convertElementName:[elementName camelize]]]) { - //element is closed, pop it from the stack - [self.unclosedProperties removeLastObject]; - //check for a parent object on the stack - if ([self.unclosedProperties count] > 0) { - //handle arrays as a special case - if ([[[self.unclosedProperties lastObject] objectAtIndex:1] isKindOfClass:[NSArray class]]) { - [[[self.unclosedProperties lastObject] objectAtIndex:1] addObject:self.parsedObject]; - } - else { - [[[self.unclosedProperties lastObject] objectAtIndex:1] setValue:self.parsedObject forKey:[self convertElementName:[elementName camelize]]]; - } - self.parsedObject = [[self.unclosedProperties lastObject] objectAtIndex:1]; - } - } - - self.contentOfCurrentProperty = nil; - - //set the parent object, if one exists, as the current element - if ([self.unclosedProperties count] > 0) { - self.currentPropertyName = [[self.unclosedProperties lastObject] objectAtIndex:0]; - } -} - - -#pragma mark cleanup - -- (void)dealloc { - [targetClass release]; - [currentPropertyName release]; - [parsedObject release]; - [contentOfCurrentProperty release]; - [unclosedProperties release]; - [currentPropertyType release]; - [super dealloc]; -} - -@end diff --git a/Classes/lib/JSONSerializable.h b/Classes/lib/JSONSerializable.h deleted file mode 100644 index 78e00a6..0000000 --- a/Classes/lib/JSONSerializable.h +++ /dev/null @@ -1,78 +0,0 @@ -// -// JSONSerializable.h -// -// Created by James Burka on 1/13/09. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@protocol JSONSerializable - -/** - * Instantiate a single instance of this class from the given JSON data. - */ -+ (id)fromJSONData:(NSData *)data; - -/** - * Instantiate a collection of instances of this class from the given JSON data. - */ -//+ (NSArray *)allFromJSONData:(NSData *)data; - -/** - * Get the full JSON representation of this object - * using the default element name: - * - * [myPerson toXMLElement] //> @"Ryan..." - */ -- (NSString *)toJSON; - - -/** - * Gets the full representation of this object minus the elements in the exclusions array - * - * - * - */ -- (NSString *)toJSONExcluding:(NSArray *)exclusions; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name: - * - * [myPerson toXMLElementAs:@"human"] //> @"Ryan..." - */ -- (NSString *)toJSONAs:(NSString *)rootName; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name and excluding the given properties. - * - * [myPerson toXMLElementAs:@"human" excludingInArray:[NSArray arrayWithObjects:@"firstName", nil]] - * - * //> @"Daigle - */ -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name and translating property names with the keyTranslations mapping. - * - * [myPerson toXMLElementAs:@"human" withTranslations:[NSDictionary dictionaryWithObjectsAndKeys:@"lastName", @"surname", nil]] - * - * //> @"RyanDaigle - */ -- (NSString *)toJSONAs:(NSString *)rootName withTranslations:(NSDictionary *)keyTranslations; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name, excluding the given properties, and translating - * property names with the keyTranslations mapping. - * - * [myPerson toXMLElementAs:@"human" excludingInArray:[NSArray arrayWithObjects:@"firstName", nil] - * withTranslations:[NSDictionary dictionaryWithObjectsAndKeys:@"lastName", @"surname", nil]] - * - * //> @"Daigle - */ -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations; - -@end \ No newline at end of file diff --git a/Classes/lib/JSONSerializableSupport.h b/Classes/lib/JSONSerializableSupport.h deleted file mode 100644 index 89139f7..0000000 --- a/Classes/lib/JSONSerializableSupport.h +++ /dev/null @@ -1,2 +0,0 @@ -#import "NSObject+JSONSerializableSupport.h" -#import "NSDictionary+JSONSerializableSupport.h" \ No newline at end of file diff --git a/Classes/lib/NSArray+XMLSerializableSupport.h b/Classes/lib/NSArray+XMLSerializableSupport.h deleted file mode 100644 index 21213af..0000000 --- a/Classes/lib/NSArray+XMLSerializableSupport.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// NSArray+XMLSerializableSupport.h -// -// -// Created by vickeryj on 9/29/08. -// Copyright 2008 Joshua Vickery. All rights reserved. -// - -#import - -@interface NSArray (XMLSerializableSupport) -- (NSString *)toXMLValue; -@end diff --git a/Classes/lib/NSArray+XMLSerializableSupport.m b/Classes/lib/NSArray+XMLSerializableSupport.m deleted file mode 100644 index 27aedc0..0000000 --- a/Classes/lib/NSArray+XMLSerializableSupport.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// NSArray+XMLSerializableSupport.m -// -// -// Created by vickeryj on 9/29/08. -// Copyright 2008 Joshua Vickery. All rights reserved. -// - -#import "NSArray+XMLSerializableSupport.h" -#import "NSObject+XMLSerializableSupport.h" - - -@implementation NSArray (XMLSerializableSupport) - -- (NSString *)toXMLValue { - NSMutableString *result = [NSMutableString string]; - - for (id element in self) { - [result appendString:[element toXMLElement]]; - } - - return result; -} - -@end diff --git a/Classes/lib/NSData+Additions.h b/Classes/lib/NSData+Additions.h deleted file mode 100644 index c02e3e0..0000000 --- a/Classes/lib/NSData+Additions.h +++ /dev/null @@ -1,12 +0,0 @@ -//NSData additions from colloquy project - -@interface NSData (NSDataAdditions) -+ (NSData *) dataWithBase64EncodedString:(NSString *) string; -- (id) initWithBase64EncodedString:(NSString *) string; - -- (NSString *) base64Encoding; -- (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength; - -- (BOOL) hasPrefix:(NSData *) prefix; -- (BOOL) hasPrefixBytes:(void *) prefix length:(unsigned int) length; -@end diff --git a/Classes/lib/NSData+Additions.m b/Classes/lib/NSData+Additions.m deleted file mode 100644 index 7b281ae..0000000 --- a/Classes/lib/NSData+Additions.m +++ /dev/null @@ -1,161 +0,0 @@ -//NSData additions from colloquy project - -// Created by khammond on Mon Oct 29 2001. -// Formatted by Timothy Hatcher on Sun Jul 4 2004. -// Copyright (c) 2001 Kyle Hammond. All rights reserved. -// Original development by Dave Winer. - -#import "NSData+Additions.h" - -static char encodingTable[64] = { -'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', -'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f', -'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', -'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' }; - -@implementation NSData (NSDataAdditions) -+ (NSData *) dataWithBase64EncodedString:(NSString *) string { - return [[[NSData allocWithZone:nil] initWithBase64EncodedString:string] autorelease]; -} - -- (id) initWithBase64EncodedString:(NSString *) string { - NSMutableData *mutableData = nil; - - if( string ) { - unsigned long ixtext = 0; - unsigned long lentext = 0; - unsigned char ch = 0; - unsigned char inbuf[4], outbuf[3]; - short i = 0, ixinbuf = 0; - BOOL flignore = NO; - BOOL flendtext = NO; - NSData *base64Data = nil; - const unsigned char *base64Bytes = nil; - - // Convert the string to ASCII data. - base64Data = [string dataUsingEncoding:NSASCIIStringEncoding]; - base64Bytes = [base64Data bytes]; - mutableData = [NSMutableData dataWithCapacity:[base64Data length]]; - lentext = [base64Data length]; - - while( YES ) { - if( ixtext >= lentext ) break; - ch = base64Bytes[ixtext++]; - flignore = NO; - - if( ( ch >= 'A' ) && ( ch <= 'Z' ) ) ch = ch - 'A'; - else if( ( ch >= 'a' ) && ( ch <= 'z' ) ) ch = ch - 'a' + 26; - else if( ( ch >= '0' ) && ( ch <= '9' ) ) ch = ch - '0' + 52; - else if( ch == '+' ) ch = 62; - else if( ch == '=' ) flendtext = YES; - else if( ch == '/' ) ch = 63; - else flignore = YES; - - if( ! flignore ) { - short ctcharsinbuf = 3; - BOOL flbreak = NO; - - if( flendtext ) { - if( ! ixinbuf ) break; - if( ( ixinbuf == 1 ) || ( ixinbuf == 2 ) ) ctcharsinbuf = 1; - else ctcharsinbuf = 2; - ixinbuf = 3; - flbreak = YES; - } - - inbuf [ixinbuf++] = ch; - - if( ixinbuf == 4 ) { - ixinbuf = 0; - outbuf [0] = ( inbuf[0] << 2 ) | ( ( inbuf[1] & 0x30) >> 4 ); - outbuf [1] = ( ( inbuf[1] & 0x0F ) << 4 ) | ( ( inbuf[2] & 0x3C ) >> 2 ); - outbuf [2] = ( ( inbuf[2] & 0x03 ) << 6 ) | ( inbuf[3] & 0x3F ); - - for( i = 0; i < ctcharsinbuf; i++ ) - [mutableData appendBytes:&outbuf[i] length:1]; - } - - if( flbreak ) break; - } - } - } - - self = [self initWithData:mutableData]; - return self; -} - -#pragma mark - - -- (NSString *) base64Encoding { - return [self base64EncodingWithLineLength:0]; -} - -- (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength { - const unsigned char *bytes = [self bytes]; - NSMutableString *result = [NSMutableString stringWithCapacity:[self length]]; - unsigned long ixtext = 0; - unsigned long lentext = [self length]; - long ctremaining = 0; - unsigned char inbuf[3], outbuf[4]; - unsigned short i = 0; - unsigned short charsonline = 0, ctcopy = 0; - unsigned long ix = 0; - - while( YES ) { - ctremaining = lentext - ixtext; - if( ctremaining <= 0 ) break; - - for( i = 0; i < 3; i++ ) { - ix = ixtext + i; - if( ix < lentext ) inbuf[i] = bytes[ix]; - else inbuf [i] = 0; - } - - outbuf [0] = (inbuf [0] & 0xFC) >> 2; - outbuf [1] = ((inbuf [0] & 0x03) << 4) | ((inbuf [1] & 0xF0) >> 4); - outbuf [2] = ((inbuf [1] & 0x0F) << 2) | ((inbuf [2] & 0xC0) >> 6); - outbuf [3] = inbuf [2] & 0x3F; - ctcopy = 4; - - switch( ctremaining ) { - case 1: - ctcopy = 2; - break; - case 2: - ctcopy = 3; - break; - } - - for( i = 0; i < ctcopy; i++ ) - [result appendFormat:@"%c", encodingTable[outbuf[i]]]; - - for( i = ctcopy; i < 4; i++ ) - [result appendString:@"="]; - - ixtext += 3; - charsonline += 4; - - if( lineLength > 0 ) { - if( charsonline >= lineLength ) { - charsonline = 0; - [result appendString:@"\n"]; - } - } - } - - return [NSString stringWithString:result]; -} - -#pragma mark - - -- (BOOL) hasPrefix:(NSData *) prefix { - unsigned int length = [prefix length]; - if( ! prefix || ! length || [self length] < length ) return NO; - return ( memcmp( [self bytes], [prefix bytes], length ) == 0 ); -} - -- (BOOL) hasPrefixBytes:(void *) prefix length:(unsigned int) length { - if( ! prefix || ! length || [self length] < length ) return NO; - return ( memcmp( [self bytes], prefix, length ) == 0 ); -} -@end diff --git a/Classes/lib/NSDate+Serialize.h b/Classes/lib/NSDate+Serialize.h deleted file mode 100644 index 048bd3e..0000000 --- a/Classes/lib/NSDate+Serialize.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// NSDate+Deserialize.h -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -@interface NSDate(Serialize) - -+ (NSDate *) deserialize:(id)value; -- (NSString *) serialize; -@end diff --git a/Classes/lib/NSDate+Serialize.m b/Classes/lib/NSDate+Serialize.m deleted file mode 100644 index 6f49a33..0000000 --- a/Classes/lib/NSDate+Serialize.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSDate+Deserialize.m -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSDate+Serialize.h" -#import "ObjectiveResourceDateFormatter.h" - - -@implementation NSDate(Serialize) - -+ (NSDate *) deserialize:(id)value { - return [ObjectiveResourceDateFormatter parseDateTime:value]; -} - -- (NSString *) serialize { - return [ObjectiveResourceDateFormatter formatDate:self]; -} - -@end diff --git a/Classes/lib/NSDate+XMLSerializableSupport.h b/Classes/lib/NSDate+XMLSerializableSupport.h deleted file mode 100644 index 1f3ef27..0000000 --- a/Classes/lib/NSDate+XMLSerializableSupport.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// NSDate+XMLSerializableSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface NSDate (XMLSerializableSupport) -- (NSString *)toXMLValue; -+ (NSDate *)fromXMLDateTimeString:(NSString *)xmlString; -+ (NSDate *)fromXMLDateString:(NSString *)xmlString; -@end diff --git a/Classes/lib/NSDate+XMLSerializableSupport.m b/Classes/lib/NSDate+XMLSerializableSupport.m deleted file mode 100644 index 387a734..0000000 --- a/Classes/lib/NSDate+XMLSerializableSupport.m +++ /dev/null @@ -1,29 +0,0 @@ -// -// NSDate+XMLSerializableSupport.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSDate+XMLSerializableSupport.h" -#import "ObjectiveResourceDateFormatter.h" - -@implementation NSDate (XMLSerializableSupport) - -//FIXME we should have one formatter for the entire app - -- (NSString *)toXMLValue { - return [ ObjectiveResourceDateFormatter formatDate:self]; -} - -+ (NSDate *)fromXMLDateTimeString:(NSString *)xmlString { - return [ ObjectiveResourceDateFormatter parseDateTime:xmlString]; -} - -+ (NSDate *)fromXMLDateString:(NSString *)xmlString { - return [ ObjectiveResourceDateFormatter parseDate:xmlString]; -} - - -@end diff --git a/Classes/lib/NSDictionary+JSONSerializableSupport.h b/Classes/lib/NSDictionary+JSONSerializableSupport.h deleted file mode 100644 index 4e962d4..0000000 --- a/Classes/lib/NSDictionary+JSONSerializableSupport.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// NSDictionary+JSONSerialization.h -// active_resource -// -// Created by James Burka on 1/15/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -@interface NSDictionary(JSONSerializableSupport) - -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations; - -@end diff --git a/Classes/lib/NSDictionary+JSONSerializableSupport.m b/Classes/lib/NSDictionary+JSONSerializableSupport.m deleted file mode 100644 index 3b0e7d7..0000000 --- a/Classes/lib/NSDictionary+JSONSerializableSupport.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// NSDictionary+JSONSerialization.m -// active_resource -// -// Created by James Burka on 1/15/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "JSONFramework.h" -#import "NSDictionary+KeyTranslation.h" -#import "NSDictionary+JSONSerializableSupport.h" -#import "ObjectiveSupport.h" -#import "Serialize.h" - -@implementation NSDictionary(JSONSerializableSupport) - -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations { - - NSMutableDictionary *props = [NSMutableDictionary dictionary]; - for (NSString *key in self) { - if(![exclusions containsObject:key]) { - NSString *convertedKey = [[self class] translationForKey:key withTranslations:keyTranslations]; - [props setObject:[[self objectForKey:key] serialize] forKey:[convertedKey underscore]]; - } - } - return [[NSDictionary dictionaryWithObject:props forKey:rootName]JSONRepresentation]; -} - -@end diff --git a/Classes/lib/NSDictionary+KeyTranslation.h b/Classes/lib/NSDictionary+KeyTranslation.h deleted file mode 100644 index 9c7b8e7..0000000 --- a/Classes/lib/NSDictionary+KeyTranslation.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSDictionary+KeyTranslation.h -// active_resource -// -// Created by James Burka on 1/15/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import - - -@interface NSDictionary(KeyTranslation) - -+ (NSString *)translationForKey:(NSString *)key withTranslations:(NSDictionary *)keyTranslations; - -@end diff --git a/Classes/lib/NSDictionary+KeyTranslation.m b/Classes/lib/NSDictionary+KeyTranslation.m deleted file mode 100644 index d1b418c..0000000 --- a/Classes/lib/NSDictionary+KeyTranslation.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSDictionary+KeyTranslation.m -// active_resource -// -// Created by James Burka on 1/15/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSDictionary+KeyTranslation.h" - - -@implementation NSDictionary(KeyTranslation) - -+ (NSString *)translationForKey:(NSString *)key withTranslations:(NSDictionary *)keyTranslations { - NSString *newKey = [keyTranslations objectForKey:key]; - return (newKey ? newKey : key); -} - -@end diff --git a/Classes/lib/NSDictionary+XMLSerializableSupport.h b/Classes/lib/NSDictionary+XMLSerializableSupport.h deleted file mode 100644 index 260a682..0000000 --- a/Classes/lib/NSDictionary+XMLSerializableSupport.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// NSDictionary+XMLSerializableSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "ComplexXMLSerializable.h" - -@interface NSDictionary (XMLSerializableSupport) - -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations; -@end diff --git a/Classes/lib/NSDictionary+XMLSerializableSupport.m b/Classes/lib/NSDictionary+XMLSerializableSupport.m deleted file mode 100644 index 6f9f543..0000000 --- a/Classes/lib/NSDictionary+XMLSerializableSupport.m +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSDictionary+XMLSerializableSupport.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSObject+XMLSerializableSupport.h" -#import "NSDictionary+KeyTranslation.h" - -@implementation NSDictionary (XMLSerializableSupport) - - - -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations { - - NSMutableString* elementValue = [NSMutableString string]; - id value; - NSString *propertyRootName; - for (NSString *key in self) { - // Create XML if key not in exclusion list - if(![exclusions containsObject:key]) { - value = [self valueForKey:key]; - propertyRootName = [[self class] translationForKey:key withTranslations:keyTranslations]; - [elementValue appendString:[value toXMLElementAs:propertyRootName]]; - } - } - return [[self class] buildXmlElementAs:rootName withInnerXml:elementValue]; -} - -@end diff --git a/Classes/lib/NSNull+XMLSerializableSupport.h b/Classes/lib/NSNull+XMLSerializableSupport.h deleted file mode 100644 index 2574f8f..0000000 --- a/Classes/lib/NSNull+XMLSerializableSupport.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// NSNull+XMLSerializableSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface NSNull (XMLSerializableSupport) -- (NSString *)toXMLValue; -@end diff --git a/Classes/lib/NSNull+XMLSerializableSupport.m b/Classes/lib/NSNull+XMLSerializableSupport.m deleted file mode 100644 index e725858..0000000 --- a/Classes/lib/NSNull+XMLSerializableSupport.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSNull+XMLSerializableSupport.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSNull+XMLSerializableSupport.h" - -@implementation NSNull (XMLSerializableSupport) - -- (NSString *)toXMLValue { - return @""; -} - -@end diff --git a/Classes/lib/NSObject+JSONSerializableSupport.h b/Classes/lib/NSObject+JSONSerializableSupport.h deleted file mode 100644 index 6fc474b..0000000 --- a/Classes/lib/NSObject+JSONSerializableSupport.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSObject+JSONSerializableSupport.h -// active_resource -// -// Created by vickeryj on 1/8/09. -// Copyright 2009 Joshua Vickery. All rights reserved. -// - -#import -#import "JSONSerializable.h" - -@interface NSObject (JSONSerializableSupport) - -+ (id)fromJSONData:(NSData *)data; -- (NSString *)toJSON; -- (NSString *)toJSONExcluding:(NSArray *)exclusions; -- (NSString *)toJSONAs:(NSString *)rootName; -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions; -- (NSString *)toJSONAs:(NSString *)rootName withTranslations:(NSDictionary *)keyTranslations; -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations; - -@end diff --git a/Classes/lib/NSObject+JSONSerializableSupport.m b/Classes/lib/NSObject+JSONSerializableSupport.m deleted file mode 100644 index 7a4f12e..0000000 --- a/Classes/lib/NSObject+JSONSerializableSupport.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// NSObject+JSONSerializableSupport.m -// active_resource -// -// Created by vickeryj on 1/8/09. -// Copyright 2009 Joshua Vickery. All rights reserved. -// - -#import "NSObject+JSONSerializableSupport.h" -#import "NSDictionary+JSONSerializableSupport.h" -#import "Serialize.h" -#import "JSONFramework.h" -#import "ObjectiveSupport.h" - -@interface NSObject (JSONSerializableSupport_Private) -+ (id) deserializeJSON:(id)jsonObject; -- (NSString *) convertProperty:(NSString *)propertyName; -- (NSString *) jsonClassName; -@end - -@implementation NSObject (JSONSerializableSupport) - -+ (id)fromJSONData:(NSData *)data { - NSString *jsonString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; - id jsonObject = [jsonString JSONValue]; - return [self deserializeJSON:jsonObject]; - -} - -- (NSString *)toJSON { - return [self toJSONAs:[self jsonClassName] excludingInArray:[NSArray array] withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toJSONExcluding:(NSArray *)exclusions { - return [self toJSONAs:[self jsonClassName] excludingInArray:exclusions withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toJSONAs:(NSString *)rootName { - return [self toJSONAs:rootName excludingInArray:[NSArray array] withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions { - return [self toJSONAs:rootName excludingInArray:exclusions withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toJSONAs:(NSString *)rootName withTranslations:(NSDictionary *)keyTranslations { - return [self toJSONAs:rootName excludingInArray:[NSArray array] withTranslations:keyTranslations]; -} - -- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations { - - return [[self properties] toJSONAs:rootName excludingInArray:exclusions withTranslations:keyTranslations]; - -} - -+ (id) propertyClass:(NSString *)className { - return NSClassFromString([className toClassName]); -} - -+ (id) deserializeJSON:(id)jsonObject { - id result = nil; - if ([jsonObject isKindOfClass:[NSArray class]]) { - //JSON array - result = [NSMutableArray array]; - for (id childObject in jsonObject) { - [result addObject:[self deserializeJSON:childObject]]; - } - } - else if ([jsonObject isKindOfClass:[NSDictionary class]]) { - //JSON object - //this assumes we are dealing with JSON in the form rails provides: - // {className : { property1 : value, property2 : {class2Name : {property 3 : value }}}} - NSString *objectName = [[(NSDictionary *)jsonObject allKeys] objectAtIndex:0]; - - Class objectClass = NSClassFromString([objectName toClassName]); - if (objectClass != nil) { - //classname matches, instantiate a new instance of the class and set it as the current parent object - result = [[[objectClass alloc] init] autorelease]; - } - - NSDictionary *properties = (NSDictionary *)[[(NSDictionary *)jsonObject allValues] objectAtIndex:0]; - - NSDictionary *objectPropertyNames = [objectClass propertyNamesAndTypes]; - - for (NSString *property in [properties allKeys]) { - NSString *propertyCamalized = [[self convertProperty:property] camelize]; - if ([[objectPropertyNames allKeys]containsObject:propertyCamalized]) { - Class propertyClass = [self propertyClass:[objectPropertyNames objectForKey:propertyCamalized]]; - [result setValue:[self deserializeJSON:[propertyClass deserialize:[properties objectForKey:property]]] forKey:propertyCamalized]; - } - } - } - else { - //JSON value - result = jsonObject; - } - return result; -} - -- (NSString *) convertProperty:(NSString *)propertyName { - if([propertyName isEqualToString:@"id"]) { - propertyName = [NSString stringWithFormat:@"%@_id",[self jsonClassName]]; - } - return propertyName; -} - -- (NSString *)jsonClassName { - NSString *className = NSStringFromClass([self class]); - return [[className stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:[[className substringToIndex:1] lowercaseString]] underscore]; -} - -@end diff --git a/Classes/lib/NSObject+PropertySupport.h b/Classes/lib/NSObject+PropertySupport.h deleted file mode 100644 index 0bd527a..0000000 --- a/Classes/lib/NSObject+PropertySupport.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// NSObject+Properties.h -// -// -// Created by Ryan Daigle on 7/28/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface NSObject (PropertySupport) - -/** - * Get the names of all properties and thier types declared on this class. - * - */ -+ (NSDictionary *)propertyNamesAndTypes; - -/** - * Get the names of all properties declared on this class. - */ -+ (NSArray *)propertyNames; - -/** - * Get all the properties and their values of this instance. - **/ -- (NSDictionary *)properties; - -/** - * Set this object's property values, overriding any existing - * values. - */ -- (void)setProperties:(NSDictionary *)overrideProperties; -@end diff --git a/Classes/lib/NSObject+PropertySupport.m b/Classes/lib/NSObject+PropertySupport.m deleted file mode 100644 index bff6541..0000000 --- a/Classes/lib/NSObject+PropertySupport.m +++ /dev/null @@ -1,76 +0,0 @@ -// -// NSObject+Properties.m -// -// -// Created by Ryan Daigle on 7/28/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "objc/runtime.h" -#import "NSObject+PropertySupport.h" - -@interface NSObject() - -+ (NSString *) getPropertyType:(NSString *)attributeString; - -@end - - -@implementation NSObject (PropertySupport) -+ (NSArray *)propertyNames { - return [[self propertyNamesAndTypes] allKeys]; -} - -+ (NSDictionary *)propertyNamesAndTypes { - NSMutableDictionary *propertyNames = [NSMutableDictionary dictionary]; - - //include superclass properties - Class currentClass = [self class]; - while (currentClass != nil) { - // Get the raw list of properties - unsigned int outCount; - objc_property_t *propList = class_copyPropertyList(currentClass, &outCount); - - // Collect the property names - int i; - NSString *propName; - for (i = 0; i < outCount; i++) - { - objc_property_t * prop = propList + i; - NSString *type = [NSString stringWithCString:property_getAttributes(*prop) encoding:NSUTF8StringEncoding]; - propName = [NSString stringWithCString:property_getName(*prop) encoding:NSUTF8StringEncoding]; - [propertyNames setObject:[self getPropertyType:type] forKey:propName]; - } - - free(propList); - currentClass = [currentClass superclass]; - } - return propertyNames; -} - -- (NSDictionary *)properties { - return [self dictionaryWithValuesForKeys:[[self class] propertyNames]]; -} - -- (void)setProperties:(NSDictionary *)overrideProperties { - for (NSString *property in [overrideProperties allKeys]) { - [self setValue:[overrideProperties objectForKey:property] forKey:property]; - } -} - -+ (NSString *) getPropertyType:(NSString *)attributeString { - NSString *type = [NSString string]; - NSScanner *typeScanner = [NSScanner scannerWithString:attributeString]; - [typeScanner scanUpToCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@"@"] intoString:NULL]; - - // we are not dealing with an object - if([typeScanner isAtEnd]) { - return @"NULL"; - } - [typeScanner scanCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@"\"@"] intoString:NULL]; - // this gets the actual object type - [typeScanner scanUpToCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@"\""] intoString:&type]; - return type; -} - -@end diff --git a/Classes/lib/NSObject+Serialize.h b/Classes/lib/NSObject+Serialize.h deleted file mode 100644 index 5d2b1af..0000000 --- a/Classes/lib/NSObject+Serialize.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// NSObject+Deserialize.h -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -@interface NSObject(Serialize) - -+ (id) deserialize:(id)value; -- (id) serialize; - -@end diff --git a/Classes/lib/NSObject+Serialize.m b/Classes/lib/NSObject+Serialize.m deleted file mode 100644 index 9401852..0000000 --- a/Classes/lib/NSObject+Serialize.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// NSObject+Deserialize.m -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSObject+Serialize.h" - - -@implementation NSObject(Serialize) - -+ (id)deserialize:(id)value { - return value; -} - -- (id) serialize { - return self; -} - -@end diff --git a/Classes/lib/NSObject+XMLSerializableSupport.h b/Classes/lib/NSObject+XMLSerializableSupport.h deleted file mode 100644 index 7e43621..0000000 --- a/Classes/lib/NSObject+XMLSerializableSupport.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// XMLSerializableSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "XMLSerializable.h" - -@interface NSObject (XMLSerializableSupport) - -/** - * Construct a string representation of the given value object, assuming - * the given root element name , the NSObjects's toXmlValue is called. - */ -+ (NSString *)buildXMLElementAs:(NSString *)rootName withValue:(NSObject *)value; - -/** - * - * Constructs the actual xml node as a string - * - */ -+ (NSString *)buildXmlElementAs:(NSString *)rootName withInnerXml:(NSString *)value; - -/** - * What is the element name for this object when serialized to XML. - * Defaults to lower case and dasherized form of class name. - * I.e. [[Person class] xmlElementName] //> @"person" - */ -+ (NSString *)xmlElementName; - -/** - * Construct the XML string representation of this particular object. - * Only construct the markup for the value of this object, don't assume - * any naming. For instance: - * - * [myObject toXMLValue] //> @"xmlSerializedValue" - * - * and not - * - * [myObject toXMLValue] //> @"xmlSerializedValue" - * - * For simple objects like strings, numbers etc this will be the text value of - * the corresponding element. For complex objects this can include further markup: - * - * [myPersonObject toXMLValue] //> @"RyanDaigle" - */ -- (NSString *)toXMLValue; - -@end diff --git a/Classes/lib/NSObject+XMLSerializableSupport.m b/Classes/lib/NSObject+XMLSerializableSupport.m deleted file mode 100644 index a6b9993..0000000 --- a/Classes/lib/NSObject+XMLSerializableSupport.m +++ /dev/null @@ -1,128 +0,0 @@ -// -// XMLSerializableSupport.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSObject+XMLSerializableSupport.h" -#import "CoreSupport.h" -#import "FromXMLElementDelegate.h" - -@implementation NSObject (XMLSerializableSupport) - -# pragma mark XML utility methods - -/** - * Get the appropriate xml type, if any, for the given value. - * I.e. "integer" or "decimal" etc... for use in element attributes: - * - * 1 - */ -+ (NSString *)xmlTypeFor:(NSObject *)value { - - // Can't do this with NSDictionary w/ Class keys. Explore more elegant solutions. - // TODO: Account for NSValue native types here? - if ([value isKindOfClass:[NSDate class]]) { - return @"datetime"; - } else if ([value isKindOfClass:[NSDecimalNumber class]]) { - return @"decimal"; - } else if ([value isKindOfClass:[NSNumber class]]) { - if (0 == strcmp("f",[(NSNumber *)value objCType]) || - 0 == strcmp("d",[(NSNumber *)value objCType])) - { - return @"decimal"; - } - else { - return @"integer"; - } - } else if ([value isKindOfClass:[NSArray class]]) { - return @"array"; - } else { - return nil; - } -} - -+ (NSString *)buildXmlElementAs:(NSString *)rootName withInnerXml:(NSString *)value { - NSString *xmlType = [self xmlTypeFor:value]; - NSString *dashedName = [rootName dasherize]; - - if (xmlType != nil) { - return [NSString stringWithFormat:@"<%@ type=\"%@\">%@", dashedName, xmlType, value, dashedName]; - } else { - return [NSString stringWithFormat:@"<%@>%@", dashedName, value, dashedName]; - } -} - -+ (NSString *)buildXMLElementAs:(NSString *)rootName withValue:(NSObject *)value { - return [[self class] buildXmlElementAs:rootName withInnerXml:[value toXMLValue]]; -} - -+ (NSString *)xmlElementName { - NSString *className = NSStringFromClass(self); - return [className stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:[[className substringToIndex:1] lowercaseString]]; -} - -# pragma mark XMLSerializable implementation methods - -- (NSString *)toXMLElement { - return [self toXMLElementAs:[[self class] xmlElementName] excludingInArray:[NSArray array] withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toXMLElementExcluding:(NSArray *)exclusions { - return [self toXMLElementAs:[[self class] xmlElementName] excludingInArray:exclusions withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toXMLElementAs:(NSString *)rootName { - return [self toXMLElementAs:rootName excludingInArray:[NSArray array] withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions { - return [self toXMLElementAs:rootName excludingInArray:exclusions withTranslations:[NSDictionary dictionary]]; -} - -- (NSString *)toXMLElementAs:(NSString *)rootName withTranslations:(NSDictionary *)keyTranslations { - return [self toXMLElementAs:rootName excludingInArray:[NSArray array] withTranslations:keyTranslations]; -} - -/** - * Override in complex objects to account for nested properties - **/ -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations { - return [[self class] buildXMLElementAs:rootName withValue:self]; -} - -# pragma mark XML Serialization convenience methods - -/** - * Override in objects that need special formatting before being printed to XML - **/ -- (NSString *)toXMLValue { - return [NSString stringWithFormat:@"%@", self]; -} - -# pragma mark XML Serialization input methods - -+ (id)fromXMLData:(NSData *)data { - - NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; - FromXMLElementDelegate *delegate = [FromXMLElementDelegate delegateForClass:self]; - [parser setDelegate:delegate]; - - // Turn off all those XML nits - [parser setShouldProcessNamespaces:NO]; - [parser setShouldReportNamespacePrefixes:NO]; - [parser setShouldResolveExternalEntities:NO]; - - // Let'er rip - [parser parse]; - [parser release]; - return delegate.parsedObject; -} - -+ (NSArray *)allFromXMLData:(NSData *)data { - return [self fromXMLData:data]; -} -@end diff --git a/Classes/lib/NSString+GSub.h b/Classes/lib/NSString+GSub.h deleted file mode 100644 index 025f18f..0000000 --- a/Classes/lib/NSString+GSub.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSString+Substitute.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface NSString (GSub) - -/** - * Perform basic substitution of given key -> value pairs - * within this string. - * - * [@"test string substitution" gsub:[NSDictionary withObjectsAndKeys:@"substitution", @"sub"]]; - * //> @"test string sub" - */ -- (NSString *)gsub:(NSDictionary *)keyValues; -@end diff --git a/Classes/lib/NSString+GSub.m b/Classes/lib/NSString+GSub.m deleted file mode 100644 index ac5ee99..0000000 --- a/Classes/lib/NSString+GSub.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// NSString+Substitute.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSString+GSub.h" - -@implementation NSString (GSub) - -- (NSString *)gsub:(NSDictionary *)keyValues { - - NSMutableString *subbed = [NSMutableString stringWithString:self]; - - for (NSString *key in keyValues) { - NSString *value = [NSString stringWithFormat:@"%@", [keyValues objectForKey:key]]; - NSArray *splits = [subbed componentsSeparatedByString:key]; - [subbed setString:[splits componentsJoinedByString:value]]; - } - return subbed; -} - -@end diff --git a/Classes/lib/NSString+InflectionSupport.h b/Classes/lib/NSString+InflectionSupport.h deleted file mode 100644 index d2b9bb3..0000000 --- a/Classes/lib/NSString+InflectionSupport.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// NSString+InflectionSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@interface NSString (InflectionSupport) - -/** - * Return the dashed form af this camelCase string: - * - * [@"camelCase" dasherize] //> @"camel-case" - */ -- (NSString *)dasherize; - -/** - * Return the underscored form af this camelCase string: - * - * [@"camelCase" underscore] //> @"camel_case" - */ -- (NSString *)underscore; - -/** - * Return the camelCase form af this dashed/underscored string: - * - * [@"camel-case_string" camelize] //> @"camelCaseString" - */ -- (NSString *)camelize; - -/** - * Return a copy of the string suitable for displaying in a title. Each word is downcased, with the first letter upcased. - */ -- (NSString *)titleize; - -/** - * Return a copy of the string with the first letter capitalized. - */ -- (NSString *)toClassName; - -@end diff --git a/Classes/lib/NSString+InflectionSupport.m b/Classes/lib/NSString+InflectionSupport.m deleted file mode 100644 index 5399dc3..0000000 --- a/Classes/lib/NSString+InflectionSupport.m +++ /dev/null @@ -1,93 +0,0 @@ -// -// NSString+InflectionSupport.m -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "NSString+InflectionSupport.h" - -@implementation NSString (InflectionSupport) - -- (NSCharacterSet *)capitals { - return [NSCharacterSet uppercaseLetterCharacterSet]; -} - -- (NSString *)deCamelizeWith:(NSString *)delimiter { - - unichar *buffer = calloc([self length], sizeof(unichar)); - [self getCharacters:buffer ]; - NSMutableString *underscored = [NSMutableString string]; - - NSString *currChar; - for (int i = 0; i < [self length]; i++) { - currChar = [NSString stringWithCharacters:buffer+i length:1]; - if([[self capitals] characterIsMember:buffer[i]]) { - [underscored appendFormat:@"%@%@", delimiter, [currChar lowercaseString]]; - } else { - [underscored appendString:currChar]; - } - } - - free(buffer); - return underscored; -} - - -- (NSString *)dasherize { - return [self deCamelizeWith:@"-"]; -} - -- (NSString *)underscore { - return [self deCamelizeWith:@"_"]; -} - -- (NSCharacterSet *)camelcaseDelimiters { - return [NSCharacterSet characterSetWithCharactersInString:@"-_"]; -} - -- (NSString *)camelize { - - unichar *buffer = calloc([self length], sizeof(unichar)); - [self getCharacters:buffer ]; - NSMutableString *underscored = [NSMutableString string]; - - BOOL capitalizeNext = NO; - NSCharacterSet *delimiters = [self camelcaseDelimiters]; - for (int i = 0; i < [self length]; i++) { - NSString *currChar = [NSString stringWithCharacters:buffer+i length:1]; - if([delimiters characterIsMember:buffer[i]]) { - capitalizeNext = YES; - } else { - if(capitalizeNext) { - [underscored appendString:[currChar uppercaseString]]; - capitalizeNext = NO; - } else { - [underscored appendString:currChar]; - } - } - } - - free(buffer); - return underscored; - -} - -- (NSString *)titleize { - NSArray *words = [self componentsSeparatedByString:@" "]; - NSMutableString *output = [NSMutableString string]; - for (NSString *word in words) { - [output appendString:[[word substringToIndex:1] uppercaseString]]; - [output appendString:[[word substringFromIndex:1] lowercaseString]]; - [output appendString:@" "]; - } - return [output substringToIndex:[self length]]; -} - -- (NSString *)toClassName { - return [self stringByReplacingCharactersInRange:NSMakeRange(0,1) - withString:[[self substringWithRange:NSMakeRange(0,1)] uppercaseString]]; -} - -@end diff --git a/Classes/lib/NSString+Serialize.h b/Classes/lib/NSString+Serialize.h deleted file mode 100644 index a597706..0000000 --- a/Classes/lib/NSString+Serialize.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSString+Deserialize.h -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import - - -@interface NSString(Deserialize) - -+ (NSString *)deserialize:(id)value; - -@end diff --git a/Classes/lib/NSString+Serialize.m b/Classes/lib/NSString+Serialize.m deleted file mode 100644 index 27bdc8d..0000000 --- a/Classes/lib/NSString+Serialize.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSString+Deserialize.m -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSString+Serialize.h" - - -@implementation NSString(Serialize) - -+ (NSString *) deserialize:(id)value { - return [NSString stringWithFormat:@"%@",value]; -} - - -@end diff --git a/Classes/lib/NSString+XMLSerializableSupport.h b/Classes/lib/NSString+XMLSerializableSupport.h deleted file mode 100644 index 9f37e77..0000000 --- a/Classes/lib/NSString+XMLSerializableSupport.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// NSString+XMLSerializableSupport.h -// active_resource -// -// Created by James Burka on 1/6/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import - - -@interface NSString(XMLSerializableSupport) - -+ (NSString *)fromXmlString:(NSString *)aString; -- (NSString *)toXMLValue; - -@end diff --git a/Classes/lib/NSString+XMLSerializableSupport.m b/Classes/lib/NSString+XMLSerializableSupport.m deleted file mode 100644 index a1fd2c5..0000000 --- a/Classes/lib/NSString+XMLSerializableSupport.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// NSString+XMLSerializableSupport.m -// active_resource -// -// Created by James Burka on 1/6/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSString+XMLSerializableSupport.h" -#import "NSObject+XMLSerializableSupport.h" -#import "NSString+GSub.h" - - -@implementation NSString(XMLSerializableSupport) - -+ (NSString *)fromXmlString:(NSString *)aString { - NSDictionary* escapeChars = [NSDictionary dictionaryWithObjectsAndKeys:@"&",@"&",@"\"",@""",@"'",@"'" - ,@"<",@"<",@">",@">",nil]; - return [aString gsub:escapeChars]; - -} - -- (NSString *)toXMLValue { - NSString *temp = [self gsub:[NSDictionary dictionaryWithObject:@"&" forKey:@"&"]]; - NSDictionary* escapeChars = [NSDictionary dictionaryWithObjectsAndKeys:@""",@"\"",@"'",@"'",@"<",@"<",@">",@">",nil]; - return [temp gsub:escapeChars]; -} - - -@end diff --git a/Classes/lib/ObjectiveResourceDateFormatter.h b/Classes/lib/ObjectiveResourceDateFormatter.h deleted file mode 100644 index dad5896..0000000 --- a/Classes/lib/ObjectiveResourceDateFormatter.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// ObjectiveResourceDateFormatter.h -// iphone-harvest -// -// Created by James Burka on 10/21/08. -// Copyright 2008 Burkaprojects. All rights reserved. -// - -#import - - -@interface ObjectiveResourceDateFormatter : NSObject { - -} - -+ (void)setDateFormatString:(NSString *)format; -+ (void)setDateTimeFormatString:(NSString *)format; -+ (NSString *)formatDate:(NSDate *)date; -+ (NSDate *)parseDate:(NSString *)dateString; -+ (NSDate *)parseDateTime:(NSString *)dateTimeString; - -@end diff --git a/Classes/lib/ObjectiveResourceDateFormatter.m b/Classes/lib/ObjectiveResourceDateFormatter.m deleted file mode 100644 index 096764f..0000000 --- a/Classes/lib/ObjectiveResourceDateFormatter.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// ObjectiveResourceDateFormatter.m -// iphone-harvest -// -// Created by James Burka on 10/21/08. -// Copyright 2008 Burkaprojects. All rights reserved. -// - -#import "ObjectiveResourceDateFormatter.h" - - -@implementation ObjectiveResourceDateFormatter - -static NSString *dateTimeFormatString = @"yyyy-MM-dd'T'HH:mm:ss'Z'"; -static NSString *dateFormatString = @"yyyy-MM-dd"; - - -+ (void)setDateFormatString:(NSString *)format { - dateFormatString = format; -} - -+ (void)setDateTimeFormatString:(NSString *)format { - dateTimeFormatString = format; -} - -+ (NSString *)formatDate:(NSDate *)date { - - NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; - [formatter setFormatterBehavior:NSDateFormatterBehavior10_4]; - [formatter setDateFormat:dateFormatString]; - [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]]; - return [formatter stringFromDate:date]; - -} - -+ (NSDate *)parseDateTime:(NSString *)dateTimeString { - - NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; - [formatter setFormatterBehavior:NSDateFormatterBehavior10_4]; - [formatter setDateFormat:dateTimeFormatString]; - [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]]; - return [formatter dateFromString:dateTimeString]; - -} - -+ (NSDate *)parseDate:(NSString *)dateString { - - NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; - [formatter setFormatterBehavior:NSDateFormatterBehavior10_4]; - [formatter setDateFormat:dateFormatString]; - [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]]; - return [formatter dateFromString:dateString]; - -} - - -@end diff --git a/Classes/lib/ObjectiveSupport.h b/Classes/lib/ObjectiveSupport.h deleted file mode 100644 index 33b8cfe..0000000 --- a/Classes/lib/ObjectiveSupport.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// ObjectiveSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "CoreSupport.h" -#import "XMLSerializableSupport.h" -#import "JSONSerializableSupport.h" \ No newline at end of file diff --git a/Classes/lib/Serialize.h b/Classes/lib/Serialize.h deleted file mode 100644 index f0820dc..0000000 --- a/Classes/lib/Serialize.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// Deserialize.h -// active_resource -// -// Created by James Burka on 1/19/09. -// Copyright 2009 Burkaprojects. All rights reserved. -// - -#import "NSObject+Serialize.h" -#import "NSDate+Serialize.h" -#import "NSString+Serialize.h" diff --git a/Classes/lib/XMLSerializable.h b/Classes/lib/XMLSerializable.h deleted file mode 100644 index 59054b9..0000000 --- a/Classes/lib/XMLSerializable.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// XMLSerializable.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -@protocol XMLSerializable - -/** - * Instantiate a single instance of this class from the given XML data. - */ -+ (id)fromXMLData:(NSData *)data; - -/** - * Instantiate a collectionof instances of this class from the given XML data. - */ -+ (NSArray *)allFromXMLData:(NSData *)data; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the default element name: - * - * [myPerson toXMLElement] //> @"Ryan..." - */ -- (NSString *)toXMLElement; - - -/** - * Gets the full representation of this object minus the elements in the exclusions array - * - * - * - */ -- (NSString *)toXMLElementExcluding:(NSArray *)exclusions; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name: - * - * [myPerson toXMLElementAs:@"human"] //> @"Ryan..." - */ -- (NSString *)toXMLElementAs:(NSString *)rootName; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name and excluding the given properties. - * - * [myPerson toXMLElementAs:@"human" excludingInArray:[NSArray arrayWithObjects:@"firstName", nil]] - * - * //> @"Daigle - */ -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name and translating property names with the keyTranslations mapping. - * - * [myPerson toXMLElementAs:@"human" withTranslations:[NSDictionary dictionaryWithObjectsAndKeys:@"lastName", @"surname", nil]] - * - * //> @"RyanDaigle - */ -- (NSString *)toXMLElementAs:(NSString *)rootName withTranslations:(NSDictionary *)keyTranslations; - -/** - * Get the full XML representation of this object (minus the xml directive) - * using the given element name, excluding the given properties, and translating - * property names with the keyTranslations mapping. - * - * [myPerson toXMLElementAs:@"human" excludingInArray:[NSArray arrayWithObjects:@"firstName", nil] - * withTranslations:[NSDictionary dictionaryWithObjectsAndKeys:@"lastName", @"surname", nil]] - * - * //> @"Daigle - */ -- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions - withTranslations:(NSDictionary *)keyTranslations; - -@end \ No newline at end of file diff --git a/Classes/lib/XMLSerializableSupport.h b/Classes/lib/XMLSerializableSupport.h deleted file mode 100644 index 267ba42..0000000 --- a/Classes/lib/XMLSerializableSupport.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// XMLSerializableSupport.h -// -// -// Created by Ryan Daigle on 7/31/08. -// Copyright 2008 yFactorial, LLC. All rights reserved. -// - -#import "XMLSerializable.h" -#import "CoreSupport.h" -#import "NSObject+XMLSerializableSupport.h" -#import "NSNull+XMLSerializableSupport.h" -#import "NSDate+XMLSerializableSupport.h" -#import "NSString+XMLSerializableSupport.h" \ No newline at end of file diff --git a/Classes/lib/json-framework/JSONFramework.h b/Classes/lib/json-framework/JSONFramework.h deleted file mode 100644 index 2a9274d..0000000 --- a/Classes/lib/json-framework/JSONFramework.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// JSONFramework.h -// iphoneAndRails1 -// -// Created by vickeryj on 12/11/08. -// Copyright 2008 Joshua Vickery. All rights reserved. -// - -#import "SBJSON.h" -#import "NSObject+SBJSON.h" -#import "NSString+SBJSON.h" \ No newline at end of file diff --git a/Classes/lib/json-framework/NSObject+SBJSON.h b/Classes/lib/json-framework/NSObject+SBJSON.h deleted file mode 100644 index 038ea8e..0000000 --- a/Classes/lib/json-framework/NSObject+SBJSON.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (C) 2007 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import - - -/// Adds JSON generation to NSObject subclasses -@interface NSObject (NSObject_SBJSON) - -/** - @brief Returns a string containing the receiver encoded as a JSON fragment. - - This method is added as a category on NSObject but is only actually - supported for the following objects: - @li NSDictionary - @li NSArray - @li NSString - @li NSNumber (also used for booleans) - @li NSNull - */ -- (NSString *)JSONFragment; - -/** - @brief Returns a string containing the receiver encoded in JSON. - - This method is added as a category on NSObject but is only actually - supported for the following objects: - @li NSDictionary - @li NSArray - */ -- (NSString *)JSONRepresentation; - -@end - diff --git a/Classes/lib/json-framework/NSObject+SBJSON.m b/Classes/lib/json-framework/NSObject+SBJSON.m deleted file mode 100644 index df6749b..0000000 --- a/Classes/lib/json-framework/NSObject+SBJSON.m +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (C) 2007 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import "NSObject+SBJSON.h" -#import "SBJSON.h" - -@implementation NSObject (NSObject_SBJSON) - -- (NSString *)JSONFragment { - SBJSON *generator = [[SBJSON new] autorelease]; - - NSError *error; - NSString *json = [generator stringWithFragment:self error:&error]; - - if (!json) - NSLog(@"%@", error); - return json; -} - -- (NSString *)JSONRepresentation { - SBJSON *generator = [[SBJSON new] autorelease]; - - NSError *error; - NSString *json = [generator stringWithObject:self error:&error]; - - if (!json) - NSLog(@"%@", error); - return json; -} - -@end diff --git a/Classes/lib/json-framework/NSString+SBJSON.h b/Classes/lib/json-framework/NSString+SBJSON.h deleted file mode 100644 index 69cfa4f..0000000 --- a/Classes/lib/json-framework/NSString+SBJSON.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright (C) 2007 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import - -/// Adds JSON parsing to NSString -@interface NSString (NSString_SBJSON) - -/// Returns the object represented in the receiver, or nil on error. -- (id)JSONFragmentValue; - -/// Returns the dictionary or array represented in the receiver, or nil on error. -- (id)JSONValue; - -@end diff --git a/Classes/lib/json-framework/NSString+SBJSON.m b/Classes/lib/json-framework/NSString+SBJSON.m deleted file mode 100644 index 69878da..0000000 --- a/Classes/lib/json-framework/NSString+SBJSON.m +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright (C) 2007 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import "NSString+SBJSON.h" -#import "SBJSON.h" - - -@implementation NSString (NSString_SBJSON) - -- (id)JSONFragmentValue -{ - SBJSON *json = [[SBJSON new] autorelease]; - - NSError *error; - id o = [json fragmentWithString:self error:&error]; - - if (!o) - NSLog(@"%@", error); - return o; -} - -- (id)JSONValue -{ - SBJSON *json = [[SBJSON new] autorelease]; - - NSError *error; - id o = [json objectWithString:self error:&error]; - - if (!o) - NSLog(@"%@", error); - return o; -} - -@end diff --git a/Classes/lib/json-framework/SBJSON.h b/Classes/lib/json-framework/SBJSON.h deleted file mode 100644 index c931d46..0000000 --- a/Classes/lib/json-framework/SBJSON.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright (C) 2008 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import - -extern NSString * SBJSONErrorDomain; - -enum { - EUNSUPPORTED = 1, - EPARSENUM, - EPARSE, - EFRAGMENT, - ECTRL, - EUNICODE, - EDEPTH, - EESCAPE, - ETRAILCOMMA, - ETRAILGARBAGE, - EEOF, - EINPUT -}; - -/** -@brief A strict JSON parser and generator - -This is the parser and generator underlying the categories added to -NSString and various other objects. - -Objective-C types are mapped to JSON types and back in the following way: - -@li NSNull -> Null -> NSNull -@li NSString -> String -> NSMutableString -@li NSArray -> Array -> NSMutableArray -@li NSDictionary -> Object -> NSMutableDictionary -@li NSNumber (-initWithBool:) -> Boolean -> NSNumber -initWithBool: -@li NSNumber -> Number -> NSDecimalNumber - -In JSON the keys of an object must be strings. NSDictionary keys need -not be, but attempting to convert an NSDictionary with non-string keys -into JSON will throw an exception. - -NSNumber instances created with the +numberWithBool: method are -converted into the JSON boolean "true" and "false" values, and vice -versa. Any other NSNumber instances are converted to a JSON number the -way you would expect. JSON numbers turn into NSDecimalNumber instances, -as we can thus avoid any loss of precision. - -Strictly speaking correctly formed JSON text must have exactly -one top-level container. (Either an Array or an Object.) Scalars, -i.e. nulls, numbers, booleans and strings, are not valid JSON on their own. -It can be quite convenient to pretend that such fragments are valid -JSON however, and this class lets you do so. - -This class does its best to be as strict as possible, both in what it -accepts and what it generates. (Other than the above mentioned support -for JSON fragments.) For example, it does not support trailing commas -in arrays or objects. Nor does it support embedded comments, or -anything else not in the JSON specification. - -*/ -@interface SBJSON : NSObject { - BOOL humanReadable; - BOOL sortKeys; - NSUInteger maxDepth; - -@private - // Used temporarily during scanning/generation - NSUInteger depth; - const char *c; -} - -/// Whether we are generating human-readable (multiline) JSON -/** - Set whether or not to generate human-readable JSON. The default is NO, which produces - JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable - JSON with linebreaks after each array value and dictionary key/value pair, indented two - spaces per nesting level. - */ -@property BOOL humanReadable; - -/// Whether or not to sort the dictionary keys in the output -/** The default is to not sort the keys. */ -@property BOOL sortKeys; - -/// The maximum depth the parser will go to -/** Defaults to 512. */ -@property NSUInteger maxDepth; - -/// Return JSON representation of an array or dictionary -- (NSString*)stringWithObject:(id)value error:(NSError**)error; - -/// Return JSON representation of any legal JSON value -- (NSString*)stringWithFragment:(id)value error:(NSError**)error; - -/// Return the object represented by the given string -- (id)objectWithString:(NSString*)jsonrep error:(NSError**)error; - -/// Return the fragment represented by the given string -- (id)fragmentWithString:(NSString*)jsonrep error:(NSError**)error; - -/// Return JSON representation (or fragment) for the given object -- (NSString*)stringWithObject:(id)value - allowScalar:(BOOL)x - error:(NSError**)error; - -/// Parse the string and return the represented object (or scalar) -- (id)objectWithString:(id)value - allowScalar:(BOOL)x - error:(NSError**)error; - -@end diff --git a/Classes/lib/json-framework/SBJSON.m b/Classes/lib/json-framework/SBJSON.m deleted file mode 100644 index 7a6ad54..0000000 --- a/Classes/lib/json-framework/SBJSON.m +++ /dev/null @@ -1,740 +0,0 @@ -/* -Copyright (C) 2008 Stig Brautaset. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#import "SBJSON.h" - -NSString * SBJSONErrorDomain = @"org.brautaset.JSON.ErrorDomain"; - -@interface SBJSON (Generator) - -- (BOOL)appendValue:(id)fragment into:(NSMutableString*)json error:(NSError**)error; -- (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json error:(NSError**)error; -- (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json error:(NSError**)error; -- (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json error:(NSError**)error; - -- (NSString*)indent; - -@end - -@interface SBJSON (Scanner) - -- (BOOL)scanValue:(NSObject **)o error:(NSError **)error; - -- (BOOL)scanRestOfArray:(NSMutableArray **)o error:(NSError **)error; -- (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o error:(NSError **)error; -- (BOOL)scanRestOfNull:(NSNull **)o error:(NSError **)error; -- (BOOL)scanRestOfFalse:(NSNumber **)o error:(NSError **)error; -- (BOOL)scanRestOfTrue:(NSNumber **)o error:(NSError **)error; -- (BOOL)scanRestOfString:(NSMutableString **)o error:(NSError **)error; - -// Cannot manage without looking at the first digit -- (BOOL)scanNumber:(NSNumber **)o error:(NSError **)error; - -- (BOOL)scanHexQuad:(unichar *)x error:(NSError **)error; -- (BOOL)scanUnicodeChar:(unichar *)x error:(NSError **)error; - -- (BOOL)scanIsAtEnd; - -@end - -#pragma mark Private utilities - -#define skipWhitespace(c) while (isspace(*c)) c++ -#define skipDigits(c) while (isdigit(*c)) c++ - -static NSError *err(int code, NSString *str) { - NSDictionary *ui = [NSDictionary dictionaryWithObject:str forKey:NSLocalizedDescriptionKey]; - return [NSError errorWithDomain:SBJSONErrorDomain code:code userInfo:ui]; -} - -static NSError *errWithUnderlier(int code, NSError **u, NSString *str) { - if (!u) - return err(code, str); - - NSDictionary *ui = [NSDictionary dictionaryWithObjectsAndKeys: - str, NSLocalizedDescriptionKey, - *u, NSUnderlyingErrorKey, - nil]; - return [NSError errorWithDomain:SBJSONErrorDomain code:code userInfo:ui]; -} - - -@implementation SBJSON - -static char ctrl[0x22]; - -+ (void)initialize -{ - ctrl[0] = '\"'; - ctrl[1] = '\\'; - for (int i = 1; i < 0x20; i++) - ctrl[i+1] = i; - ctrl[0x21] = 0; -} - -- (id)init { - if (self = [super init]) { - [self setMaxDepth:512]; - } - return self; -} - -#pragma mark Generator - - -/** - Returns a string containing JSON representation of the passed in value, or nil on error. - If nil is returned and @p error is not NULL, @p *error can be interrogated to find the cause of the error. - - @param value any instance that can be represented as a JSON fragment - @param allowScalar wether to return json fragments for scalar objects - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (NSString*)stringWithObject:(id)value allowScalar:(BOOL)allowScalar error:(NSError**)error { - depth = 0; - NSMutableString *json = [NSMutableString stringWithCapacity:128]; - - NSError *err2 = nil; - if (!allowScalar && ![value isKindOfClass:[NSDictionary class]] && ![value isKindOfClass:[NSArray class]]) { - err2 = err(EFRAGMENT, @"Not valid type for JSON"); - - } else if ([self appendValue:value into:json error:&err2]) { - return json; - } - - if (error) - *error = err2; - return nil; -} - -/** - Returns a string containing JSON representation of the passed in value, or nil on error. - If nil is returned and @p error is not NULL, @p error can be interrogated to find the cause of the error. - - @param value any instance that can be represented as a JSON fragment - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (NSString*)stringWithFragment:(id)value error:(NSError**)error { - return [self stringWithObject:value allowScalar:YES error:error]; -} - -/** - Returns a string containing JSON representation of the passed in value, or nil on error. - If nil is returned and @p error is not NULL, @p error can be interrogated to find the cause of the error. - - @param value a NSDictionary or NSArray instance - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (NSString*)stringWithObject:(id)value error:(NSError**)error { - return [self stringWithObject:value allowScalar:NO error:error]; -} - - -- (NSString*)indent { - return [@"\n" stringByPaddingToLength:1 + 2 * depth withString:@" " startingAtIndex:0]; -} - -- (BOOL)appendValue:(id)fragment into:(NSMutableString*)json error:(NSError**)error { - if ([fragment isKindOfClass:[NSDictionary class]]) { - if (![self appendDictionary:fragment into:json error:error]) - return NO; - - } else if ([fragment isKindOfClass:[NSArray class]]) { - if (![self appendArray:fragment into:json error:error]) - return NO; - - } else if ([fragment isKindOfClass:[NSString class]]) { - if (![self appendString:fragment into:json error:error]) - return NO; - - } else if ([fragment isKindOfClass:[NSNumber class]]) { - if ('c' == *[fragment objCType]) - [json appendString:[fragment boolValue] ? @"true" : @"false"]; - else - [json appendString:[fragment stringValue]]; - - } else if ([fragment isKindOfClass:[NSNull class]]) { - [json appendString:@"null"]; - - } else { - *error = err(EUNSUPPORTED, [NSString stringWithFormat:@"JSON serialisation not supported for %@", [fragment class]]); - return NO; - } - return YES; -} - -- (BOOL)appendArray:(NSArray*)fragment into:(NSMutableString*)json error:(NSError**)error { - [json appendString:@"["]; - depth++; - - BOOL addComma = NO; - for (id value in fragment) { - if (addComma) - [json appendString:@","]; - else - addComma = YES; - - if ([self humanReadable]) - [json appendString:[self indent]]; - - if (![self appendValue:value into:json error:error]) { - return NO; - } - } - - depth--; - if ([self humanReadable] && [fragment count]) - [json appendString:[self indent]]; - [json appendString:@"]"]; - return YES; -} - -- (BOOL)appendDictionary:(NSDictionary*)fragment into:(NSMutableString*)json error:(NSError**)error { - [json appendString:@"{"]; - depth++; - - NSString *colon = [self humanReadable] ? @" : " : @":"; - BOOL addComma = NO; - NSArray *keys = [fragment allKeys]; - if (self.sortKeys) - keys = [keys sortedArrayUsingSelector:@selector(compare:)]; - - for (id value in keys) { - if (addComma) - [json appendString:@","]; - else - addComma = YES; - - if ([self humanReadable]) - [json appendString:[self indent]]; - - if (![value isKindOfClass:[NSString class]]) { - *error = err(EUNSUPPORTED, @"JSON object key must be string"); - return NO; - } - - if (![self appendString:value into:json error:error]) - return NO; - - [json appendString:colon]; - if (![self appendValue:[fragment objectForKey:value] into:json error:error]) { - *error = err(EUNSUPPORTED, [NSString stringWithFormat:@"Unsupported value for key %@ in object", value]); - return NO; - } - } - - depth--; - if ([self humanReadable] && [fragment count]) - [json appendString:[self indent]]; - [json appendString:@"}"]; - return YES; -} - -- (BOOL)appendString:(NSString*)fragment into:(NSMutableString*)json error:(NSError**)error { - - static NSMutableCharacterSet *kEscapeChars; - if( ! kEscapeChars ) { - kEscapeChars = [[NSMutableCharacterSet characterSetWithRange: NSMakeRange(0,32)] retain]; - [kEscapeChars addCharactersInString: @"\"\\"]; - } - - [json appendString:@"\""]; - - NSRange esc = [fragment rangeOfCharacterFromSet:kEscapeChars]; - if ( !esc.length ) { - // No special chars -- can just add the raw string: - [json appendString:fragment]; - - } else { - NSUInteger length = [fragment length]; - for (NSUInteger i = 0; i < length; i++) { - unichar uc = [fragment characterAtIndex:i]; - switch (uc) { - case '"': [json appendString:@"\\\""]; break; - case '\\': [json appendString:@"\\\\"]; break; - case '\t': [json appendString:@"\\t"]; break; - case '\n': [json appendString:@"\\n"]; break; - case '\r': [json appendString:@"\\r"]; break; - case '\b': [json appendString:@"\\b"]; break; - case '\f': [json appendString:@"\\f"]; break; - default: - if (uc < 0x20) { - [json appendFormat:@"\\u%04x", uc]; - } else { - [json appendFormat:@"%C", uc]; - } - break; - - } - } - } - - [json appendString:@"\""]; - return YES; -} - -#pragma mark Parser - -/** - Returns the object represented by the passed-in string or nil on error. The returned object can be - a string, number, boolean, null, array or dictionary. - - @param repr the json string to parse - @param allowScalar whether to return objects for JSON fragments - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (id)objectWithString:(id)repr allowScalar:(BOOL)allowScalar error:(NSError**)error { - - if (!repr) { - if (error) - *error = err(EINPUT, @"Input was 'nil'"); - return nil; - } - - depth = 0; - c = [repr UTF8String]; - - id o; - NSError *err2 = nil; - if (![self scanValue:&o error:&err2]) { - if (error) - *error = err2; - return nil; - } - - // We found some valid JSON. But did it also contain something else? - if (![self scanIsAtEnd]) { - if (error) - *error = err(ETRAILGARBAGE, @"Garbage after JSON"); - return nil; - } - - // If we don't allow scalars, check that the object we've found is a valid JSON container. - if (!allowScalar && ![o isKindOfClass:[NSDictionary class]] && ![o isKindOfClass:[NSArray class]]) { - if (error) - *error = err(EFRAGMENT, @"Valid fragment, but not JSON"); - return nil; - } - - NSAssert1(o, @"Should have a valid object from %@", repr); - return o; -} - -/** - Returns the object represented by the passed-in string or nil on error. The returned object can be - a string, number, boolean, null, array or dictionary. - - @param repr the json string to parse - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (id)fragmentWithString:(NSString*)repr error:(NSError**)error { - return [self objectWithString:repr allowScalar:YES error:error]; -} - -/** - Returns the object represented by the passed-in string or nil on error. The returned object - will be either a dictionary or an array. - - @param repr the json string to parse - @param error used to return an error by reference (pass NULL if this is not desired) - */ -- (id)objectWithString:(NSString*)repr error:(NSError**)error { - return [self objectWithString:repr allowScalar:NO error:error]; -} - -/* - In contrast to the public methods, it is an error to omit the error parameter here. - */ -- (BOOL)scanValue:(NSObject **)o error:(NSError **)error -{ - skipWhitespace(c); - - switch (*c++) { - case '{': - return [self scanRestOfDictionary:(NSMutableDictionary **)o error:error]; - break; - case '[': - return [self scanRestOfArray:(NSMutableArray **)o error:error]; - break; - case '"': - return [self scanRestOfString:(NSMutableString **)o error:error]; - break; - case 'f': - return [self scanRestOfFalse:(NSNumber **)o error:error]; - break; - case 't': - return [self scanRestOfTrue:(NSNumber **)o error:error]; - break; - case 'n': - return [self scanRestOfNull:(NSNull **)o error:error]; - break; - case '-': - case '0'...'9': - c--; // cannot verify number correctly without the first character - return [self scanNumber:(NSNumber **)o error:error]; - break; - case '+': - *error = err(EPARSENUM, @"Leading + disallowed in number"); - return NO; - break; - case 0x0: - *error = err(EEOF, @"Unexpected end of string"); - return NO; - break; - default: - *error = err(EPARSE, @"Unrecognised leading character"); - return NO; - break; - } - - NSAssert(0, @"Should never get here"); - return NO; -} - -- (BOOL)scanRestOfTrue:(NSNumber **)o error:(NSError **)error -{ - if (!strncmp(c, "rue", 3)) { - c += 3; - *o = [NSNumber numberWithBool:YES]; - return YES; - } - *error = err(EPARSE, @"Expected 'true'"); - return NO; -} - -- (BOOL)scanRestOfFalse:(NSNumber **)o error:(NSError **)error -{ - if (!strncmp(c, "alse", 4)) { - c += 4; - *o = [NSNumber numberWithBool:NO]; - return YES; - } - *error = err(EPARSE, @"Expected 'false'"); - return NO; -} - -- (BOOL)scanRestOfNull:(NSNull **)o error:(NSError **)error -{ - if (!strncmp(c, "ull", 3)) { - c += 3; - *o = [NSNull null]; - return YES; - } - *error = err(EPARSE, @"Expected 'null'"); - return NO; -} - -- (BOOL)scanRestOfArray:(NSMutableArray **)o error:(NSError **)error -{ - if (maxDepth && ++depth > maxDepth) { - *error = err(EDEPTH, @"Nested too deep"); - return NO; - } - - *o = [NSMutableArray arrayWithCapacity:8]; - - for (; *c ;) { - id v; - - skipWhitespace(c); - if (*c == ']' && c++) { - depth--; - return YES; - } - - if (![self scanValue:&v error:error]) { - *error = errWithUnderlier(EPARSE, error, @"Expected value while parsing array"); - return NO; - } - - [*o addObject:v]; - - skipWhitespace(c); - if (*c == ',' && c++) { - skipWhitespace(c); - if (*c == ']') { - *error = err(ETRAILCOMMA, @"Trailing comma disallowed in array"); - return NO; - } - } - } - - *error = err(EEOF, @"End of input while parsing array"); - return NO; -} - -- (BOOL)scanRestOfDictionary:(NSMutableDictionary **)o error:(NSError **)error -{ - if (maxDepth && ++depth > maxDepth) { - *error = err(EDEPTH, @"Nested too deep"); - return NO; - } - - *o = [NSMutableDictionary dictionaryWithCapacity:7]; - - for (; *c ;) { - id k, v; - - skipWhitespace(c); - if (*c == '}' && c++) { - depth--; - return YES; - } - - if (!(*c == '\"' && c++ && [self scanRestOfString:&k error:error])) { - *error = errWithUnderlier(EPARSE, error, @"Object key string expected"); - return NO; - } - - skipWhitespace(c); - if (*c != ':') { - *error = err(EPARSE, @"Expected ':' separating key and value"); - return NO; - } - - c++; - if (![self scanValue:&v error:error]) { - NSString *string = [NSString stringWithFormat:@"Object value expected for key: %@", k]; - *error = errWithUnderlier(EPARSE, error, string); - return NO; - } - - [*o setObject:v forKey:k]; - - skipWhitespace(c); - if (*c == ',' && c++) { - skipWhitespace(c); - if (*c == '}') { - *error = err(ETRAILCOMMA, @"Trailing comma disallowed in object"); - return NO; - } - } - } - - *error = err(EEOF, @"End of input while parsing object"); - return NO; -} - -- (BOOL)scanRestOfString:(NSMutableString **)o error:(NSError **)error -{ - *o = [NSMutableString stringWithCapacity:16]; - do { - // First see if there's a portion we can grab in one go. - // Doing this caused a massive speedup on the long string. - size_t len = strcspn(c, ctrl); - if (len) { - // check for - id t = [[NSString alloc] initWithBytesNoCopy:(char*)c - length:len - encoding:NSUTF8StringEncoding - freeWhenDone:NO]; - if (t) { - [*o appendString:t]; - [t release]; - c += len; - } - } - - if (*c == '"') { - c++; - return YES; - - } else if (*c == '\\') { - unichar uc = *++c; - switch (uc) { - case '\\': - case '/': - case '"': - break; - - case 'b': uc = '\b'; break; - case 'n': uc = '\n'; break; - case 'r': uc = '\r'; break; - case 't': uc = '\t'; break; - case 'f': uc = '\f'; break; - - case 'u': - c++; - if (![self scanUnicodeChar:&uc error:error]) { - *error = errWithUnderlier(EUNICODE, error, @"Broken unicode character"); - return NO; - } - c--; // hack. - break; - default: - *error = err(EESCAPE, [NSString stringWithFormat:@"Illegal escape sequence '0x%x'", uc]); - return NO; - break; - } - [*o appendFormat:@"%C", uc]; - c++; - - } else if (*c < 0x20) { - *error = err(ECTRL, [NSString stringWithFormat:@"Unescaped control character '0x%x'", *c]); - return NO; - - } else { - NSLog(@"should not be able to get here"); - } - } while (*c); - - *error = err(EEOF, @"Unexpected EOF while parsing string"); - return NO; -} - -- (BOOL)scanUnicodeChar:(unichar *)x error:(NSError **)error -{ - unichar hi, lo; - - if (![self scanHexQuad:&hi error:error]) { - *error = err(EUNICODE, @"Missing hex quad"); - return NO; - } - - if (hi >= 0xd800) { // high surrogate char? - if (hi < 0xdc00) { // yes - expect a low char - - if (!(*c == '\\' && ++c && *c == 'u' && ++c && [self scanHexQuad:&lo error:error])) { - *error = errWithUnderlier(EUNICODE, error, @"Missing low character in surrogate pair"); - return NO; - } - - if (lo < 0xdc00 || lo >= 0xdfff) { - *error = err(EUNICODE, @"Invalid low surrogate char"); - return NO; - } - - hi = (hi - 0xd800) * 0x400 + (lo - 0xdc00) + 0x10000; - - } else if (hi < 0xe000) { - *error = err(EUNICODE, @"Invalid high character in surrogate pair"); - return NO; - } - } - - *x = hi; - return YES; -} - -- (BOOL)scanHexQuad:(unichar *)x error:(NSError **)error -{ - *x = 0; - for (int i = 0; i < 4; i++) { - unichar uc = *c; - c++; - int d = (uc >= '0' && uc <= '9') - ? uc - '0' : (uc >= 'a' && uc <= 'f') - ? (uc - 'a' + 10) : (uc >= 'A' && uc <= 'F') - ? (uc - 'A' + 10) : -1; - if (d == -1) { - *error = err(EUNICODE, @"Missing hex digit in quad"); - return NO; - } - *x *= 16; - *x += d; - } - return YES; -} - -- (BOOL)scanNumber:(NSNumber **)o error:(NSError **)error -{ - const char *ns = c; - - // The logic to test for validity of the number formatting is relicensed - // from JSON::XS with permission from its author Marc Lehmann. - // (Available at the CPAN: http://search.cpan.org/dist/JSON-XS/ .) - - if ('-' == *c) - c++; - - if ('0' == *c && c++) { - if (isdigit(*c)) { - *error = err(EPARSENUM, @"Leading 0 disallowed in number"); - return NO; - } - - } else if (!isdigit(*c) && c != ns) { - *error = err(EPARSENUM, @"No digits after initial minus"); - return NO; - - } else { - skipDigits(c); - } - - // Fractional part - if ('.' == *c && c++) { - - if (!isdigit(*c)) { - *error = err(EPARSENUM, @"No digits after decimal point"); - return NO; - } - skipDigits(c); - } - - // Exponential part - if ('e' == *c || 'E' == *c) { - c++; - - if ('-' == *c || '+' == *c) - c++; - - if (!isdigit(*c)) { - *error = err(EPARSENUM, @"No digits after exponent"); - return NO; - } - skipDigits(c); - } - - id str = [[NSString alloc] initWithBytesNoCopy:(char*)ns - length:c - ns - encoding:NSUTF8StringEncoding - freeWhenDone:NO]; - [str autorelease]; - if (str && (*o = [NSDecimalNumber decimalNumberWithString:str])) - return YES; - - *error = err(EPARSENUM, @"Failed creating decimal instance"); - return NO; -} - -- (BOOL)scanIsAtEnd -{ - skipWhitespace(c); - return !*c; -} - - - -#pragma mark Properties - -@synthesize humanReadable; -@synthesize sortKeys; -@synthesize maxDepth; - -@end diff --git a/Classes/lib/objective_support b/Classes/lib/objective_support new file mode 160000 index 0000000..d98966a --- /dev/null +++ b/Classes/lib/objective_support @@ -0,0 +1 @@ +Subproject commit d98966a1899b7671a8c3a12feed71c7f813a7155 diff --git a/README.textile b/README.textile index 3a6f391..3221896 100644 --- a/README.textile +++ b/README.textile @@ -5,8 +5,10 @@ ObjectiveResource is a port of Rails' ActiveResource framework to Objective-C. The primary purpose of this project is to quickly and easily connect iPhone applications with servers running Rails. -A secondary goal of this project is to provide some popular Rubyisms to -Objective-C. This work can be found in the ActiveSupport group. +This project relies on ObjectiveSupport, which aims to provide some popular +Rubyisms to Objective-C. If you checkout this project using git, you can +pull down ObjectiveSupport by doing a "git submodule init" followed by +a "git submodule update". h2. Getting Started @@ -19,6 +21,6 @@ up the .xcodeproj and fire up a rails server in sample_rails_app. h3. Integrating with your project # Download (clone) the objectiveresource project -## If you are using git you can checkout objectiveresource as a submodule +## If you do a git clone, you will need to follow it up with "git submodule init" and "git submodule update" # open the .xcodeproj in XCode for both objectiveresource and your iPhone project # drag the ActiveResource and ActiveSupport groups from the objectiveresource project onto your iPhone project diff --git a/objective_resource.xcodeproj/project.pbxproj b/objective_resource.xcodeproj/project.pbxproj index 74bd141..f659db8 100755 --- a/objective_resource.xcodeproj/project.pbxproj +++ b/objective_resource.xcodeproj/project.pbxproj @@ -17,12 +17,6 @@ 23829E0E0EA393DA0070F0BF /* EditDogViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 23829E0D0EA393DA0070F0BF /* EditDogViewController.xib */; }; 23829F010EA39B3B0070F0BF /* ViewDogController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23829F000EA39B3B0070F0BF /* ViewDogController.m */; }; 23829F120EA39C430070F0BF /* ViewDogController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 23829F110EA39C430070F0BF /* ViewDogController.xib */; }; - 239AC9D20F2574EA00F5B672 /* NSObject+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239AC9D10F2574EA00F5B672 /* NSObject+Serialize.m */; }; - 239AC9D30F2574EA00F5B672 /* NSObject+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239AC9D10F2574EA00F5B672 /* NSObject+Serialize.m */; }; - 239ACA150F25789700F5B672 /* NSDate+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239ACA140F25789700F5B672 /* NSDate+Serialize.m */; }; - 239ACA160F25789700F5B672 /* NSDate+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239ACA140F25789700F5B672 /* NSDate+Serialize.m */; }; - 239ACA3E0F2579D000F5B672 /* NSString+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239ACA3D0F2579D000F5B672 /* NSString+Serialize.m */; }; - 239ACA3F0F2579D000F5B672 /* NSString+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 239ACA3D0F2579D000F5B672 /* NSString+Serialize.m */; }; 239D4FFC0EA690BC00318802 /* GTMSenTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D4FFB0EA690BC00318802 /* GTMSenTestCase.m */; }; 239D50010EA690E600318802 /* GTMIPhoneUnitTestDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D4FE80EA6906100318802 /* GTMIPhoneUnitTestDelegate.m */; }; 239D50020EA690E600318802 /* GTMIPhoneUnitTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D4FE90EA6906100318802 /* GTMIPhoneUnitTestMain.m */; }; @@ -32,15 +26,6 @@ 239D501E0EA691AC00318802 /* ObjectiveResource+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91960E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m */; }; 239D501F0EA691AC00318802 /* ObjectiveResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91980E9A55EF0025D9AF /* ObjectiveResource.m */; }; 239D50200EA691AC00318802 /* Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A919B0E9A55EF0025D9AF /* Connection.m */; }; - 239D50210EA691AC00318802 /* FromXMLElementDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A919E0E9A55EF0025D9AF /* FromXMLElementDelegate.m */; }; - 239D50220EA691AC00318802 /* NSArray+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A00E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m */; }; - 239D50230EA691AC00318802 /* NSDate+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A20E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m */; }; - 239D50240EA691AC00318802 /* NSDictionary+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A40E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m */; }; - 239D50250EA691AC00318802 /* NSNull+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A60E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m */; }; - 239D50260EA691AC00318802 /* NSObject+PropertySupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A80E9A55EF0025D9AF /* NSObject+PropertySupport.m */; }; - 239D50270EA691AC00318802 /* NSObject+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AA0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m */; }; - 239D50280EA691AC00318802 /* NSString+GSub.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AC0E9A55EF0025D9AF /* NSString+GSub.m */; }; - 239D50290EA691AC00318802 /* NSString+InflectionSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AE0E9A55EF0025D9AF /* NSString+InflectionSupport.m */; }; 239D502A0EA691AC00318802 /* Response.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91B00E9A55EF0025D9AF /* Response.m */; }; 239D502B0EA691AC00318802 /* EditDogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23829E0B0EA393700070F0BF /* EditDogViewController.m */; }; 239D502C0EA691AC00318802 /* ViewDogController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23829F000EA39B3B0070F0BF /* ViewDogController.m */; }; @@ -49,48 +34,63 @@ 239D50CB0EA691DD00318802 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 239D50DA0EA6921800318802 /* DogTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D50D90EA6921800318802 /* DogTest.m */; }; 239D50E70EA694F300318802 /* rails_boot_strap.rb in Resources */ = {isa = PBXBuildFile; fileRef = 239D50E60EA694F300318802 /* rails_boot_strap.rb */; }; - 239D75CD0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D75CC0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m */; }; - 239D75CE0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 239D75CC0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m */; }; 23B4A6420F092B620021AB9D /* DogErrorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B4A6410F092B620021AB9D /* DogErrorTest.m */; }; 23C922800F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C9227F0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m */; }; 23C922810F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C9227F0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m */; }; 23C922F30F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C922F20F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m */; }; 23C922F40F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C922F20F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m */; }; - 23E62A920F2011070083A66B /* NSDictionary+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E62A910F2011070083A66B /* NSDictionary+JSONSerializableSupport.m */; }; - 23E62A930F2011070083A66B /* NSDictionary+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E62A910F2011070083A66B /* NSDictionary+JSONSerializableSupport.m */; }; - 23E62A990F2013B90083A66B /* NSDictionary+KeyTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E62A980F2013B90083A66B /* NSDictionary+KeyTranslation.m */; }; - 23E62A9A0F2013B90083A66B /* NSDictionary+KeyTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E62A980F2013B90083A66B /* NSDictionary+KeyTranslation.m */; }; - 23F71FFB0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F71FFA0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m */; }; - 23F71FFC0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F71FFA0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m */; }; 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 350420F40E5E15AA00493366 /* DogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 350420F30E5E15AA00493366 /* DogViewController.m */; }; 350421290E5E1A0F00493366 /* Dog.m in Sources */ = {isa = PBXBuildFile; fileRef = 350421280E5E1A0F00493366 /* Dog.m */; }; 350421870E5E1BF200493366 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 350421860E5E1BF200493366 /* CoreGraphics.framework */; }; 350421CB0E5E1E0900493366 /* AddDogView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 350421CA0E5E1E0900493366 /* AddDogView.xib */; }; 350421CF0E5E1EC500493366 /* AddDogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 350421CE0E5E1EC500493366 /* AddDogViewController.m */; }; - 3506000D0EA7FCCA0085CBDF /* NSData+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3506000C0EA7FCCA0085CBDF /* NSData+Additions.m */; }; - 350600110EA7FCDF0085CBDF /* NSData+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3506000C0EA7FCCA0085CBDF /* NSData+Additions.m */; }; - 3520BE850F16482800BEF309 /* NSObject+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 3520BE840F16482800BEF309 /* NSObject+JSONSerializableSupport.m */; }; - 3520BE860F16482800BEF309 /* NSObject+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 3520BE840F16482800BEF309 /* NSObject+JSONSerializableSupport.m */; }; 357A91B40E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91960E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m */; }; 357A91B50E9A55EF0025D9AF /* ObjectiveResource.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91980E9A55EF0025D9AF /* ObjectiveResource.m */; }; 357A91B60E9A55EF0025D9AF /* Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A919B0E9A55EF0025D9AF /* Connection.m */; }; - 357A91B70E9A55EF0025D9AF /* FromXMLElementDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A919E0E9A55EF0025D9AF /* FromXMLElementDelegate.m */; }; - 357A91B80E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A00E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m */; }; - 357A91B90E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A20E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m */; }; - 357A91BA0E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A40E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m */; }; - 357A91BB0E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A60E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m */; }; - 357A91BC0E9A55EF0025D9AF /* NSObject+PropertySupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91A80E9A55EF0025D9AF /* NSObject+PropertySupport.m */; }; - 357A91BD0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AA0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m */; }; - 357A91BE0E9A55EF0025D9AF /* NSString+GSub.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AC0E9A55EF0025D9AF /* NSString+GSub.m */; }; - 357A91BF0E9A55EF0025D9AF /* NSString+InflectionSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91AE0E9A55EF0025D9AF /* NSString+InflectionSupport.m */; }; 357A91C00E9A55EF0025D9AF /* Response.m in Sources */ = {isa = PBXBuildFile; fileRef = 357A91B00E9A55EF0025D9AF /* Response.m */; }; - 35C6753C0F2E020B005FF6CE /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C675370F2E020B005FF6CE /* NSObject+SBJSON.m */; }; - 35C6753D0F2E020B005FF6CE /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C675390F2E020B005FF6CE /* NSString+SBJSON.m */; }; - 35C6753E0F2E020B005FF6CE /* SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6753B0F2E020B005FF6CE /* SBJSON.m */; }; - 35C6753F0F2E020B005FF6CE /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C675370F2E020B005FF6CE /* NSObject+SBJSON.m */; }; - 35C675400F2E020B005FF6CE /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C675390F2E020B005FF6CE /* NSString+SBJSON.m */; }; - 35C675410F2E020B005FF6CE /* SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6753B0F2E020B005FF6CE /* SBJSON.m */; }; + 35C679300F2E70C2005FF6CE /* NSString+InflectionSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C678FC0F2E70C2005FF6CE /* NSString+InflectionSupport.m */; }; + 35C679310F2E70C2005FF6CE /* NSData+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C678FE0F2E70C2005FF6CE /* NSData+Additions.m */; }; + 35C679320F2E70C2005FF6CE /* NSObject+PropertySupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679000F2E70C2005FF6CE /* NSObject+PropertySupport.m */; }; + 35C679330F2E70C2005FF6CE /* NSString+GSub.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679020F2E70C2005FF6CE /* NSString+GSub.m */; }; + 35C679340F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679040F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m */; }; + 35C679350F2E70C2005FF6CE /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679090F2E70C2005FF6CE /* NSObject+SBJSON.m */; }; + 35C679360F2E70C2005FF6CE /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6790B0F2E70C2005FF6CE /* NSString+SBJSON.m */; }; + 35C679370F2E70C2005FF6CE /* SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6790D0F2E70C2005FF6CE /* SBJSON.m */; }; + 35C679380F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679130F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m */; }; + 35C679390F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679150F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m */; }; + 35C6793A0F2E70C2005FF6CE /* NSDate+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679170F2E70C2005FF6CE /* NSDate+Serialize.m */; }; + 35C6793B0F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679190F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m */; }; + 35C6793C0F2E70C2005FF6CE /* NSObject+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6791B0F2E70C2005FF6CE /* NSObject+Serialize.m */; }; + 35C6793D0F2E70C2005FF6CE /* NSString+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6791D0F2E70C2005FF6CE /* NSString+Serialize.m */; }; + 35C6793E0F2E70C2005FF6CE /* FromXMLElementDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679210F2E70C2005FF6CE /* FromXMLElementDelegate.m */; }; + 35C6793F0F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679230F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m */; }; + 35C679400F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679250F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m */; }; + 35C679410F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679270F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m */; }; + 35C679420F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679290F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m */; }; + 35C679430F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6792B0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m */; }; + 35C679440F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6792D0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m */; }; + 35C679450F2E70C2005FF6CE /* NSString+InflectionSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C678FC0F2E70C2005FF6CE /* NSString+InflectionSupport.m */; }; + 35C679460F2E70C2005FF6CE /* NSData+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C678FE0F2E70C2005FF6CE /* NSData+Additions.m */; }; + 35C679470F2E70C2005FF6CE /* NSObject+PropertySupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679000F2E70C2005FF6CE /* NSObject+PropertySupport.m */; }; + 35C679480F2E70C2005FF6CE /* NSString+GSub.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679020F2E70C2005FF6CE /* NSString+GSub.m */; }; + 35C679490F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679040F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m */; }; + 35C6794A0F2E70C2005FF6CE /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679090F2E70C2005FF6CE /* NSObject+SBJSON.m */; }; + 35C6794B0F2E70C2005FF6CE /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6790B0F2E70C2005FF6CE /* NSString+SBJSON.m */; }; + 35C6794C0F2E70C2005FF6CE /* SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6790D0F2E70C2005FF6CE /* SBJSON.m */; }; + 35C6794D0F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679130F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m */; }; + 35C6794E0F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679150F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m */; }; + 35C6794F0F2E70C2005FF6CE /* NSDate+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679170F2E70C2005FF6CE /* NSDate+Serialize.m */; }; + 35C679500F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679190F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m */; }; + 35C679510F2E70C2005FF6CE /* NSObject+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6791B0F2E70C2005FF6CE /* NSObject+Serialize.m */; }; + 35C679520F2E70C2005FF6CE /* NSString+Serialize.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6791D0F2E70C2005FF6CE /* NSString+Serialize.m */; }; + 35C679530F2E70C2005FF6CE /* FromXMLElementDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679210F2E70C2005FF6CE /* FromXMLElementDelegate.m */; }; + 35C679540F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679230F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m */; }; + 35C679550F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679250F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m */; }; + 35C679560F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679270F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m */; }; + 35C679570F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C679290F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m */; }; + 35C679580F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6792B0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m */; }; + 35C679590F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C6792D0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m */; }; 35CA32650F1E67A1001513AA /* ConnectionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CA32640F1E67A1001513AA /* ConnectionDelegate.m */; }; 35CA32660F1E67A1001513AA /* ConnectionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CA32640F1E67A1001513AA /* ConnectionDelegate.m */; }; /* End PBXBuildFile section */ @@ -101,8 +101,6 @@ 1D3623250D0F684500981E51 /* objective_resourceAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = objective_resourceAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* objective_resource.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = objective_resource.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 232C77860F1E482F009B254D /* JSONSerializable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSONSerializable.h; path = lib/JSONSerializable.h; sourceTree = ""; }; - 23493DF50F1E8D9C00E3AF41 /* JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSONSerializableSupport.h; path = lib/JSONSerializableSupport.h; sourceTree = ""; }; 2377C4F30F019E67006E155F /* NSHTTPURLResponse+Error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSHTTPURLResponse+Error.h"; path = "lib/NSHTTPURLResponse+Error.h"; sourceTree = ""; }; 2377C4F40F019E67006E155F /* NSHTTPURLResponse+Error.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSHTTPURLResponse+Error.m"; path = "lib/NSHTTPURLResponse+Error.m"; sourceTree = ""; }; 23829E0A0EA393700070F0BF /* EditDogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditDogViewController.h; sourceTree = ""; }; @@ -111,13 +109,6 @@ 23829EFF0EA39B3B0070F0BF /* ViewDogController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewDogController.h; sourceTree = ""; }; 23829F000EA39B3B0070F0BF /* ViewDogController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewDogController.m; sourceTree = ""; }; 23829F110EA39C430070F0BF /* ViewDogController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewDogController.xib; sourceTree = ""; }; - 239AC9D00F2574EA00F5B672 /* NSObject+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+Serialize.h"; path = "lib/NSObject+Serialize.h"; sourceTree = ""; }; - 239AC9D10F2574EA00F5B672 /* NSObject+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+Serialize.m"; path = "lib/NSObject+Serialize.m"; sourceTree = ""; }; - 239ACA130F25789700F5B672 /* NSDate+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDate+Serialize.h"; path = "lib/NSDate+Serialize.h"; sourceTree = ""; }; - 239ACA140F25789700F5B672 /* NSDate+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDate+Serialize.m"; path = "lib/NSDate+Serialize.m"; sourceTree = ""; }; - 239ACA3C0F2579D000F5B672 /* NSString+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+Serialize.h"; path = "lib/NSString+Serialize.h"; sourceTree = ""; }; - 239ACA3D0F2579D000F5B672 /* NSString+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+Serialize.m"; path = "lib/NSString+Serialize.m"; sourceTree = ""; }; - 239ACA400F257A2A00F5B672 /* Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Serialize.h; path = lib/Serialize.h; sourceTree = ""; }; 239D4FE70EA6906100318802 /* GTMIPhoneUnitTestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMIPhoneUnitTestDelegate.h; path = google_toolbar/UnitTesting/GTMIPhoneUnitTestDelegate.h; sourceTree = SOURCE_ROOT; }; 239D4FE80EA6906100318802 /* GTMIPhoneUnitTestDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMIPhoneUnitTestDelegate.m; path = google_toolbar/UnitTesting/GTMIPhoneUnitTestDelegate.m; sourceTree = SOURCE_ROOT; }; 239D4FE90EA6906100318802 /* GTMIPhoneUnitTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMIPhoneUnitTestMain.m; path = google_toolbar/UnitTesting/GTMIPhoneUnitTestMain.m; sourceTree = SOURCE_ROOT; }; @@ -129,20 +120,12 @@ 239D50D80EA6921800318802 /* DogTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DogTest.h; sourceTree = ""; }; 239D50D90EA6921800318802 /* DogTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DogTest.m; sourceTree = ""; }; 239D50E60EA694F300318802 /* rails_boot_strap.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rails_boot_strap.rb; sourceTree = ""; }; - 239D75CB0EAF8D3700664953 /* ObjectiveResourceDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectiveResourceDateFormatter.h; path = lib/ObjectiveResourceDateFormatter.h; sourceTree = ""; }; - 239D75CC0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ObjectiveResourceDateFormatter.m; path = lib/ObjectiveResourceDateFormatter.m; sourceTree = ""; }; 23B4A6400F092B620021AB9D /* DogErrorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DogErrorTest.h; sourceTree = ""; }; 23B4A6410F092B620021AB9D /* DogErrorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DogErrorTest.m; sourceTree = ""; }; 23C9227E0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "ObjectiveResource+JSONSerializableSupport.h"; path = "lib/ObjectiveResource+JSONSerializableSupport.h"; sourceTree = ""; }; 23C9227F0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "ObjectiveResource+JSONSerializableSupport.m"; path = "lib/ObjectiveResource+JSONSerializableSupport.m"; sourceTree = ""; }; 23C922F10F25066900EDE8AF /* NSMutableURLRequest+ResponseType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableURLRequest+ResponseType.h"; path = "lib/NSMutableURLRequest+ResponseType.h"; sourceTree = ""; }; 23C922F20F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableURLRequest+ResponseType.m"; path = "lib/NSMutableURLRequest+ResponseType.m"; sourceTree = ""; }; - 23E62A900F2011070083A66B /* NSDictionary+JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+JSONSerializableSupport.h"; path = "lib/NSDictionary+JSONSerializableSupport.h"; sourceTree = ""; }; - 23E62A910F2011070083A66B /* NSDictionary+JSONSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+JSONSerializableSupport.m"; path = "lib/NSDictionary+JSONSerializableSupport.m"; sourceTree = ""; }; - 23E62A970F2013B90083A66B /* NSDictionary+KeyTranslation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+KeyTranslation.h"; path = "lib/NSDictionary+KeyTranslation.h"; sourceTree = ""; }; - 23E62A980F2013B90083A66B /* NSDictionary+KeyTranslation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+KeyTranslation.m"; path = "lib/NSDictionary+KeyTranslation.m"; sourceTree = ""; }; - 23F71FF90F13FDFC009C7C2E /* NSString+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+XMLSerializableSupport.h"; path = "lib/NSString+XMLSerializableSupport.h"; sourceTree = ""; }; - 23F71FFA0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+XMLSerializableSupport.m"; path = "lib/NSString+XMLSerializableSupport.m"; sourceTree = ""; }; 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* objective_resource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objective_resource_Prefix.pch; sourceTree = ""; }; @@ -154,47 +137,64 @@ 350421CA0E5E1E0900493366 /* AddDogView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddDogView.xib; sourceTree = ""; }; 350421CD0E5E1EC500493366 /* AddDogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddDogViewController.h; sourceTree = ""; }; 350421CE0E5E1EC500493366 /* AddDogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddDogViewController.m; sourceTree = ""; }; - 3506000B0EA7FCCA0085CBDF /* NSData+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+Additions.h"; path = "lib/NSData+Additions.h"; sourceTree = ""; }; - 3506000C0EA7FCCA0085CBDF /* NSData+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+Additions.m"; path = "lib/NSData+Additions.m"; sourceTree = ""; }; - 3520BE830F16482800BEF309 /* NSObject+JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+JSONSerializableSupport.h"; path = "lib/NSObject+JSONSerializableSupport.h"; sourceTree = ""; }; - 3520BE840F16482800BEF309 /* NSObject+JSONSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+JSONSerializableSupport.m"; path = "lib/NSObject+JSONSerializableSupport.m"; sourceTree = ""; }; 357A91950E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "ObjectiveResource+XMLSerializableSupport.h"; path = "lib/ObjectiveResource+XMLSerializableSupport.h"; sourceTree = ""; }; 357A91960E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "ObjectiveResource+XMLSerializableSupport.m"; path = "lib/ObjectiveResource+XMLSerializableSupport.m"; sourceTree = ""; }; 357A91970E9A55EF0025D9AF /* ObjectiveResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectiveResource.h; path = lib/ObjectiveResource.h; sourceTree = ""; }; 357A91980E9A55EF0025D9AF /* ObjectiveResource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ObjectiveResource.m; path = lib/ObjectiveResource.m; sourceTree = ""; }; - 357A91990E9A55EF0025D9AF /* ObjectiveSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectiveSupport.h; path = lib/ObjectiveSupport.h; sourceTree = ""; }; 357A919A0E9A55EF0025D9AF /* Connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Connection.h; path = lib/Connection.h; sourceTree = ""; }; 357A919B0E9A55EF0025D9AF /* Connection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Connection.m; path = lib/Connection.m; sourceTree = ""; }; - 357A919C0E9A55EF0025D9AF /* CoreSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoreSupport.h; path = lib/CoreSupport.h; sourceTree = ""; }; - 357A919D0E9A55EF0025D9AF /* FromXMLElementDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FromXMLElementDelegate.h; path = lib/FromXMLElementDelegate.h; sourceTree = ""; }; - 357A919E0E9A55EF0025D9AF /* FromXMLElementDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FromXMLElementDelegate.m; path = lib/FromXMLElementDelegate.m; sourceTree = ""; }; - 357A919F0E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSArray+XMLSerializableSupport.h"; path = "lib/NSArray+XMLSerializableSupport.h"; sourceTree = ""; }; - 357A91A00E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSArray+XMLSerializableSupport.m"; path = "lib/NSArray+XMLSerializableSupport.m"; sourceTree = ""; }; - 357A91A10E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDate+XMLSerializableSupport.h"; path = "lib/NSDate+XMLSerializableSupport.h"; sourceTree = ""; }; - 357A91A20E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDate+XMLSerializableSupport.m"; path = "lib/NSDate+XMLSerializableSupport.m"; sourceTree = ""; }; - 357A91A30E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+XMLSerializableSupport.h"; path = "lib/NSDictionary+XMLSerializableSupport.h"; sourceTree = ""; }; - 357A91A40E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+XMLSerializableSupport.m"; path = "lib/NSDictionary+XMLSerializableSupport.m"; sourceTree = ""; }; - 357A91A50E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSNull+XMLSerializableSupport.h"; path = "lib/NSNull+XMLSerializableSupport.h"; sourceTree = ""; }; - 357A91A60E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSNull+XMLSerializableSupport.m"; path = "lib/NSNull+XMLSerializableSupport.m"; sourceTree = ""; }; - 357A91A70E9A55EF0025D9AF /* NSObject+PropertySupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+PropertySupport.h"; path = "lib/NSObject+PropertySupport.h"; sourceTree = ""; }; - 357A91A80E9A55EF0025D9AF /* NSObject+PropertySupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+PropertySupport.m"; path = "lib/NSObject+PropertySupport.m"; sourceTree = ""; }; - 357A91A90E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+XMLSerializableSupport.h"; path = "lib/NSObject+XMLSerializableSupport.h"; sourceTree = ""; }; - 357A91AA0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+XMLSerializableSupport.m"; path = "lib/NSObject+XMLSerializableSupport.m"; sourceTree = ""; }; - 357A91AB0E9A55EF0025D9AF /* NSString+GSub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+GSub.h"; path = "lib/NSString+GSub.h"; sourceTree = ""; }; - 357A91AC0E9A55EF0025D9AF /* NSString+GSub.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+GSub.m"; path = "lib/NSString+GSub.m"; sourceTree = ""; }; - 357A91AD0E9A55EF0025D9AF /* NSString+InflectionSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+InflectionSupport.h"; path = "lib/NSString+InflectionSupport.h"; sourceTree = ""; }; - 357A91AE0E9A55EF0025D9AF /* NSString+InflectionSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+InflectionSupport.m"; path = "lib/NSString+InflectionSupport.m"; sourceTree = ""; }; 357A91AF0E9A55EF0025D9AF /* Response.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Response.h; path = lib/Response.h; sourceTree = ""; }; 357A91B00E9A55EF0025D9AF /* Response.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Response.m; path = lib/Response.m; sourceTree = ""; }; - 357A91B10E9A55EF0025D9AF /* XMLSerializable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLSerializable.h; path = lib/XMLSerializable.h; sourceTree = ""; }; - 357A91B20E9A55EF0025D9AF /* XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLSerializableSupport.h; path = lib/XMLSerializableSupport.h; sourceTree = ""; }; - 35C675350F2E020B005FF6CE /* JSONFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONFramework.h; sourceTree = ""; }; - 35C675360F2E020B005FF6CE /* NSObject+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+SBJSON.h"; sourceTree = ""; }; - 35C675370F2E020B005FF6CE /* NSObject+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SBJSON.m"; sourceTree = ""; }; - 35C675380F2E020B005FF6CE /* NSString+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SBJSON.h"; sourceTree = ""; }; - 35C675390F2E020B005FF6CE /* NSString+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SBJSON.m"; sourceTree = ""; }; - 35C6753A0F2E020B005FF6CE /* SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJSON.h; sourceTree = ""; }; - 35C6753B0F2E020B005FF6CE /* SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJSON.m; sourceTree = ""; }; + 35C678F90F2E70C2005FF6CE /* CoreSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSupport.h; sourceTree = ""; }; + 35C678FB0F2E70C2005FF6CE /* NSString+InflectionSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+InflectionSupport.h"; sourceTree = ""; }; + 35C678FC0F2E70C2005FF6CE /* NSString+InflectionSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+InflectionSupport.m"; sourceTree = ""; }; + 35C678FD0F2E70C2005FF6CE /* NSData+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Additions.h"; sourceTree = ""; }; + 35C678FE0F2E70C2005FF6CE /* NSData+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Additions.m"; sourceTree = ""; }; + 35C678FF0F2E70C2005FF6CE /* NSObject+PropertySupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+PropertySupport.h"; sourceTree = ""; }; + 35C679000F2E70C2005FF6CE /* NSObject+PropertySupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+PropertySupport.m"; sourceTree = ""; }; + 35C679010F2E70C2005FF6CE /* NSString+GSub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+GSub.h"; sourceTree = ""; }; + 35C679020F2E70C2005FF6CE /* NSString+GSub.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+GSub.m"; sourceTree = ""; }; + 35C679030F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectiveResourceDateFormatter.h; sourceTree = ""; }; + 35C679040F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjectiveResourceDateFormatter.m; sourceTree = ""; }; + 35C679050F2E70C2005FF6CE /* ObjectiveSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectiveSupport.h; sourceTree = ""; }; + 35C679070F2E70C2005FF6CE /* JSONFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONFramework.h; sourceTree = ""; }; + 35C679080F2E70C2005FF6CE /* NSObject+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+SBJSON.h"; sourceTree = ""; }; + 35C679090F2E70C2005FF6CE /* NSObject+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SBJSON.m"; sourceTree = ""; }; + 35C6790A0F2E70C2005FF6CE /* NSString+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SBJSON.h"; sourceTree = ""; }; + 35C6790B0F2E70C2005FF6CE /* NSString+SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SBJSON.m"; sourceTree = ""; }; + 35C6790C0F2E70C2005FF6CE /* SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJSON.h; sourceTree = ""; }; + 35C6790D0F2E70C2005FF6CE /* SBJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJSON.m; sourceTree = ""; }; + 35C679100F2E70C2005FF6CE /* JSONSerializable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONSerializable.h; sourceTree = ""; }; + 35C679110F2E70C2005FF6CE /* JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONSerializableSupport.h; sourceTree = ""; }; + 35C679120F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+JSONSerializableSupport.h"; sourceTree = ""; }; + 35C679130F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+JSONSerializableSupport.m"; sourceTree = ""; }; + 35C679140F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+JSONSerializableSupport.h"; sourceTree = ""; }; + 35C679150F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+JSONSerializableSupport.m"; sourceTree = ""; }; + 35C679160F2E70C2005FF6CE /* NSDate+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Serialize.h"; sourceTree = ""; }; + 35C679170F2E70C2005FF6CE /* NSDate+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Serialize.m"; sourceTree = ""; }; + 35C679180F2E70C2005FF6CE /* NSDictionary+KeyTranslation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+KeyTranslation.h"; sourceTree = ""; }; + 35C679190F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+KeyTranslation.m"; sourceTree = ""; }; + 35C6791A0F2E70C2005FF6CE /* NSObject+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+Serialize.h"; sourceTree = ""; }; + 35C6791B0F2E70C2005FF6CE /* NSObject+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Serialize.m"; sourceTree = ""; }; + 35C6791C0F2E70C2005FF6CE /* NSString+Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Serialize.h"; sourceTree = ""; }; + 35C6791D0F2E70C2005FF6CE /* NSString+Serialize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Serialize.m"; sourceTree = ""; }; + 35C6791E0F2E70C2005FF6CE /* Serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Serialize.h; sourceTree = ""; }; + 35C679200F2E70C2005FF6CE /* FromXMLElementDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FromXMLElementDelegate.h; sourceTree = ""; }; + 35C679210F2E70C2005FF6CE /* FromXMLElementDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FromXMLElementDelegate.m; sourceTree = ""; }; + 35C679220F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C679230F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C679240F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C679250F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C679260F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C679270F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C679280F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNull+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C679290F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNull+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C6792A0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C6792B0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C6792C0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+XMLSerializableSupport.h"; sourceTree = ""; }; + 35C6792D0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+XMLSerializableSupport.m"; sourceTree = ""; }; + 35C6792E0F2E70C2005FF6CE /* XMLSerializable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLSerializable.h; sourceTree = ""; }; + 35C6792F0F2E70C2005FF6CE /* XMLSerializableSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLSerializableSupport.h; sourceTree = ""; }; 35CA32630F1E67A1001513AA /* ConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionDelegate.h; path = lib/ConnectionDelegate.h; sourceTree = ""; }; 35CA32640F1E67A1001513AA /* ConnectionDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ConnectionDelegate.m; path = lib/ConnectionDelegate.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -227,9 +227,9 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + 35C678F70F2E70C2005FF6CE /* ObjectiveSupport */, 239D4FE30EA68FAC00318802 /* GoogleTestUnit */, 357A915B0E9A436E0025D9AF /* ObjectiveResource */, - 357A91400E9A436E0025D9AF /* ObjectiveSupport */, 350420F10E5E153C00493366 /* Example */, ); path = Classes; @@ -279,7 +279,6 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 35C675340F2E020B005FF6CE /* json-framework */, 239D50E50EA694B400318802 /* RailsBootStrap */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, @@ -342,148 +341,141 @@ name = Example; sourceTree = ""; }; - 3520BE6F0F16437500BEF309 /* JSON */ = { - isa = PBXGroup; - children = ( - 23493DF50F1E8D9C00E3AF41 /* JSONSerializableSupport.h */, - 3520BE830F16482800BEF309 /* NSObject+JSONSerializableSupport.h */, - 3520BE840F16482800BEF309 /* NSObject+JSONSerializableSupport.m */, - 232C77860F1E482F009B254D /* JSONSerializable.h */, - 23E62A900F2011070083A66B /* NSDictionary+JSONSerializableSupport.h */, - 23E62A910F2011070083A66B /* NSDictionary+JSONSerializableSupport.m */, - ); - name = JSON; - sourceTree = ""; - }; - 357A91400E9A436E0025D9AF /* ObjectiveSupport */ = { + 357A915B0E9A436E0025D9AF /* ObjectiveResource */ = { isa = PBXGroup; children = ( - 357A914A0E9A436E0025D9AF /* Serialization */, - 357A91410E9A436E0025D9AF /* Core */, + 357A91630E9A436E0025D9AF /* Connection */, + 357A91950E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.h */, + 357A91960E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m */, + 357A91970E9A55EF0025D9AF /* ObjectiveResource.h */, + 357A91980E9A55EF0025D9AF /* ObjectiveResource.m */, + 23C9227E0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.h */, + 23C9227F0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m */, ); - name = ObjectiveSupport; + name = ObjectiveResource; sourceTree = ""; }; - 357A91410E9A436E0025D9AF /* Core */ = { + 357A91630E9A436E0025D9AF /* Connection */ = { isa = PBXGroup; children = ( - 357A91470E9A436E0025D9AF /* Inflections */, - 3506000B0EA7FCCA0085CBDF /* NSData+Additions.h */, - 3506000C0EA7FCCA0085CBDF /* NSData+Additions.m */, - 357A91990E9A55EF0025D9AF /* ObjectiveSupport.h */, - 357A919C0E9A55EF0025D9AF /* CoreSupport.h */, - 357A91A70E9A55EF0025D9AF /* NSObject+PropertySupport.h */, - 357A91A80E9A55EF0025D9AF /* NSObject+PropertySupport.m */, - 357A91AB0E9A55EF0025D9AF /* NSString+GSub.h */, - 357A91AC0E9A55EF0025D9AF /* NSString+GSub.m */, - ); - name = Core; + 35CA32630F1E67A1001513AA /* ConnectionDelegate.h */, + 35CA32640F1E67A1001513AA /* ConnectionDelegate.m */, + 2377C4F30F019E67006E155F /* NSHTTPURLResponse+Error.h */, + 2377C4F40F019E67006E155F /* NSHTTPURLResponse+Error.m */, + 357A919A0E9A55EF0025D9AF /* Connection.h */, + 357A919B0E9A55EF0025D9AF /* Connection.m */, + 357A91AF0E9A55EF0025D9AF /* Response.h */, + 357A91B00E9A55EF0025D9AF /* Response.m */, + 23C922F10F25066900EDE8AF /* NSMutableURLRequest+ResponseType.h */, + 23C922F20F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m */, + ); + name = Connection; sourceTree = ""; }; - 357A91470E9A436E0025D9AF /* Inflections */ = { + 35C678F70F2E70C2005FF6CE /* ObjectiveSupport */ = { isa = PBXGroup; children = ( - 357A91AD0E9A55EF0025D9AF /* NSString+InflectionSupport.h */, - 357A91AE0E9A55EF0025D9AF /* NSString+InflectionSupport.m */, + 35C678F80F2E70C2005FF6CE /* Core */, + 35C679060F2E70C2005FF6CE /* json-framework */, + 35C6790E0F2E70C2005FF6CE /* Serialization */, ); - name = Inflections; + name = ObjectiveSupport; + path = lib/objective_support/Classes/lib; sourceTree = ""; }; - 357A914A0E9A436E0025D9AF /* Serialization */ = { + 35C678F80F2E70C2005FF6CE /* Core */ = { isa = PBXGroup; children = ( - 239AC9D00F2574EA00F5B672 /* NSObject+Serialize.h */, - 239AC9D10F2574EA00F5B672 /* NSObject+Serialize.m */, - 239ACA130F25789700F5B672 /* NSDate+Serialize.h */, - 239ACA140F25789700F5B672 /* NSDate+Serialize.m */, - 239ACA3C0F2579D000F5B672 /* NSString+Serialize.h */, - 239ACA3D0F2579D000F5B672 /* NSString+Serialize.m */, - 239ACA400F257A2A00F5B672 /* Serialize.h */, - 3520BE6F0F16437500BEF309 /* JSON */, - 357A914B0E9A436E0025D9AF /* XML */, - 23E62A970F2013B90083A66B /* NSDictionary+KeyTranslation.h */, - 23E62A980F2013B90083A66B /* NSDictionary+KeyTranslation.m */, - ); - name = Serialization; + 35C678F90F2E70C2005FF6CE /* CoreSupport.h */, + 35C678FA0F2E70C2005FF6CE /* Inflections */, + 35C678FD0F2E70C2005FF6CE /* NSData+Additions.h */, + 35C678FE0F2E70C2005FF6CE /* NSData+Additions.m */, + 35C678FF0F2E70C2005FF6CE /* NSObject+PropertySupport.h */, + 35C679000F2E70C2005FF6CE /* NSObject+PropertySupport.m */, + 35C679010F2E70C2005FF6CE /* NSString+GSub.h */, + 35C679020F2E70C2005FF6CE /* NSString+GSub.m */, + 35C679030F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.h */, + 35C679040F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m */, + 35C679050F2E70C2005FF6CE /* ObjectiveSupport.h */, + ); + path = Core; sourceTree = ""; }; - 357A914B0E9A436E0025D9AF /* XML */ = { + 35C678FA0F2E70C2005FF6CE /* Inflections */ = { isa = PBXGroup; children = ( - 23F71FF90F13FDFC009C7C2E /* NSString+XMLSerializableSupport.h */, - 23F71FFA0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m */, - 239D75CB0EAF8D3700664953 /* ObjectiveResourceDateFormatter.h */, - 239D75CC0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m */, - 357A91580E9A436E0025D9AF /* Delegates */, - 357A91B10E9A55EF0025D9AF /* XMLSerializable.h */, - 357A91B20E9A55EF0025D9AF /* XMLSerializableSupport.h */, - 357A919F0E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.h */, - 357A91A00E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m */, - 357A91A10E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.h */, - 357A91A20E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m */, - 357A91A30E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.h */, - 357A91A40E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m */, - 357A91A50E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.h */, - 357A91A60E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m */, - 357A91A90E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.h */, - 357A91AA0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m */, - ); - name = XML; + 35C678FB0F2E70C2005FF6CE /* NSString+InflectionSupport.h */, + 35C678FC0F2E70C2005FF6CE /* NSString+InflectionSupport.m */, + ); + path = Inflections; sourceTree = ""; }; - 357A91580E9A436E0025D9AF /* Delegates */ = { + 35C679060F2E70C2005FF6CE /* json-framework */ = { isa = PBXGroup; children = ( - 357A919D0E9A55EF0025D9AF /* FromXMLElementDelegate.h */, - 357A919E0E9A55EF0025D9AF /* FromXMLElementDelegate.m */, - ); - name = Delegates; + 35C679070F2E70C2005FF6CE /* JSONFramework.h */, + 35C679080F2E70C2005FF6CE /* NSObject+SBJSON.h */, + 35C679090F2E70C2005FF6CE /* NSObject+SBJSON.m */, + 35C6790A0F2E70C2005FF6CE /* NSString+SBJSON.h */, + 35C6790B0F2E70C2005FF6CE /* NSString+SBJSON.m */, + 35C6790C0F2E70C2005FF6CE /* SBJSON.h */, + 35C6790D0F2E70C2005FF6CE /* SBJSON.m */, + ); + path = "json-framework"; sourceTree = ""; }; - 357A915B0E9A436E0025D9AF /* ObjectiveResource */ = { + 35C6790E0F2E70C2005FF6CE /* Serialization */ = { isa = PBXGroup; children = ( - 357A91630E9A436E0025D9AF /* Connection */, - 357A91950E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.h */, - 357A91960E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m */, - 357A91970E9A55EF0025D9AF /* ObjectiveResource.h */, - 357A91980E9A55EF0025D9AF /* ObjectiveResource.m */, - 23C9227E0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.h */, - 23C9227F0F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m */, - ); - name = ObjectiveResource; + 35C6790F0F2E70C2005FF6CE /* JSON */, + 35C679160F2E70C2005FF6CE /* NSDate+Serialize.h */, + 35C679170F2E70C2005FF6CE /* NSDate+Serialize.m */, + 35C679180F2E70C2005FF6CE /* NSDictionary+KeyTranslation.h */, + 35C679190F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m */, + 35C6791A0F2E70C2005FF6CE /* NSObject+Serialize.h */, + 35C6791B0F2E70C2005FF6CE /* NSObject+Serialize.m */, + 35C6791C0F2E70C2005FF6CE /* NSString+Serialize.h */, + 35C6791D0F2E70C2005FF6CE /* NSString+Serialize.m */, + 35C6791E0F2E70C2005FF6CE /* Serialize.h */, + 35C6791F0F2E70C2005FF6CE /* XML */, + ); + path = Serialization; sourceTree = ""; }; - 357A91630E9A436E0025D9AF /* Connection */ = { + 35C6790F0F2E70C2005FF6CE /* JSON */ = { isa = PBXGroup; children = ( - 35CA32630F1E67A1001513AA /* ConnectionDelegate.h */, - 35CA32640F1E67A1001513AA /* ConnectionDelegate.m */, - 2377C4F30F019E67006E155F /* NSHTTPURLResponse+Error.h */, - 2377C4F40F019E67006E155F /* NSHTTPURLResponse+Error.m */, - 357A919A0E9A55EF0025D9AF /* Connection.h */, - 357A919B0E9A55EF0025D9AF /* Connection.m */, - 357A91AF0E9A55EF0025D9AF /* Response.h */, - 357A91B00E9A55EF0025D9AF /* Response.m */, - 23C922F10F25066900EDE8AF /* NSMutableURLRequest+ResponseType.h */, - 23C922F20F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m */, - ); - name = Connection; + 35C679100F2E70C2005FF6CE /* JSONSerializable.h */, + 35C679110F2E70C2005FF6CE /* JSONSerializableSupport.h */, + 35C679120F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.h */, + 35C679130F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m */, + 35C679140F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.h */, + 35C679150F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m */, + ); + path = JSON; sourceTree = ""; }; - 35C675340F2E020B005FF6CE /* json-framework */ = { + 35C6791F0F2E70C2005FF6CE /* XML */ = { isa = PBXGroup; children = ( - 35C675350F2E020B005FF6CE /* JSONFramework.h */, - 35C675360F2E020B005FF6CE /* NSObject+SBJSON.h */, - 35C675370F2E020B005FF6CE /* NSObject+SBJSON.m */, - 35C675380F2E020B005FF6CE /* NSString+SBJSON.h */, - 35C675390F2E020B005FF6CE /* NSString+SBJSON.m */, - 35C6753A0F2E020B005FF6CE /* SBJSON.h */, - 35C6753B0F2E020B005FF6CE /* SBJSON.m */, - ); - name = "json-framework"; - path = "Classes/lib/json-framework"; + 35C679200F2E70C2005FF6CE /* FromXMLElementDelegate.h */, + 35C679210F2E70C2005FF6CE /* FromXMLElementDelegate.m */, + 35C679220F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.h */, + 35C679230F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m */, + 35C679240F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.h */, + 35C679250F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m */, + 35C679260F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.h */, + 35C679270F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m */, + 35C679280F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.h */, + 35C679290F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m */, + 35C6792A0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.h */, + 35C6792B0F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m */, + 35C6792C0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.h */, + 35C6792D0F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m */, + 35C6792E0F2E70C2005FF6CE /* XMLSerializable.h */, + 35C6792F0F2E70C2005FF6CE /* XMLSerializableSupport.h */, + ); + path = XML; sourceTree = ""; }; /* End PBXGroup section */ @@ -576,34 +568,34 @@ 357A91B40E9A55EF0025D9AF /* ObjectiveResource+XMLSerializableSupport.m in Sources */, 357A91B50E9A55EF0025D9AF /* ObjectiveResource.m in Sources */, 357A91B60E9A55EF0025D9AF /* Connection.m in Sources */, - 357A91B70E9A55EF0025D9AF /* FromXMLElementDelegate.m in Sources */, - 357A91B80E9A55EF0025D9AF /* NSArray+XMLSerializableSupport.m in Sources */, - 357A91B90E9A55EF0025D9AF /* NSDate+XMLSerializableSupport.m in Sources */, - 357A91BA0E9A55EF0025D9AF /* NSDictionary+XMLSerializableSupport.m in Sources */, - 357A91BB0E9A55EF0025D9AF /* NSNull+XMLSerializableSupport.m in Sources */, - 357A91BC0E9A55EF0025D9AF /* NSObject+PropertySupport.m in Sources */, - 357A91BD0E9A55EF0025D9AF /* NSObject+XMLSerializableSupport.m in Sources */, - 357A91BE0E9A55EF0025D9AF /* NSString+GSub.m in Sources */, - 357A91BF0E9A55EF0025D9AF /* NSString+InflectionSupport.m in Sources */, 357A91C00E9A55EF0025D9AF /* Response.m in Sources */, 23829E0C0EA393700070F0BF /* EditDogViewController.m in Sources */, 23829F010EA39B3B0070F0BF /* ViewDogController.m in Sources */, - 3506000D0EA7FCCA0085CBDF /* NSData+Additions.m in Sources */, - 239D75CD0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m in Sources */, 2377C4F50F019E67006E155F /* NSHTTPURLResponse+Error.m in Sources */, - 23F71FFB0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m in Sources */, - 3520BE850F16482800BEF309 /* NSObject+JSONSerializableSupport.m in Sources */, - 23E62A920F2011070083A66B /* NSDictionary+JSONSerializableSupport.m in Sources */, - 23E62A990F2013B90083A66B /* NSDictionary+KeyTranslation.m in Sources */, 23C922800F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m in Sources */, 23C922F40F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m in Sources */, - 239AC9D30F2574EA00F5B672 /* NSObject+Serialize.m in Sources */, - 239ACA160F25789700F5B672 /* NSDate+Serialize.m in Sources */, - 239ACA3F0F2579D000F5B672 /* NSString+Serialize.m in Sources */, 35CA32650F1E67A1001513AA /* ConnectionDelegate.m in Sources */, - 35C6753C0F2E020B005FF6CE /* NSObject+SBJSON.m in Sources */, - 35C6753D0F2E020B005FF6CE /* NSString+SBJSON.m in Sources */, - 35C6753E0F2E020B005FF6CE /* SBJSON.m in Sources */, + 35C679300F2E70C2005FF6CE /* NSString+InflectionSupport.m in Sources */, + 35C679310F2E70C2005FF6CE /* NSData+Additions.m in Sources */, + 35C679320F2E70C2005FF6CE /* NSObject+PropertySupport.m in Sources */, + 35C679330F2E70C2005FF6CE /* NSString+GSub.m in Sources */, + 35C679340F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m in Sources */, + 35C679350F2E70C2005FF6CE /* NSObject+SBJSON.m in Sources */, + 35C679360F2E70C2005FF6CE /* NSString+SBJSON.m in Sources */, + 35C679370F2E70C2005FF6CE /* SBJSON.m in Sources */, + 35C679380F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m in Sources */, + 35C679390F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m in Sources */, + 35C6793A0F2E70C2005FF6CE /* NSDate+Serialize.m in Sources */, + 35C6793B0F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m in Sources */, + 35C6793C0F2E70C2005FF6CE /* NSObject+Serialize.m in Sources */, + 35C6793D0F2E70C2005FF6CE /* NSString+Serialize.m in Sources */, + 35C6793E0F2E70C2005FF6CE /* FromXMLElementDelegate.m in Sources */, + 35C6793F0F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m in Sources */, + 35C679400F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m in Sources */, + 35C679410F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m in Sources */, + 35C679420F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m in Sources */, + 35C679430F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m in Sources */, + 35C679440F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -613,20 +605,10 @@ files = ( 239D501A0EA691AC00318802 /* DogViewController.m in Sources */, 239D501B0EA691AC00318802 /* Dog.m in Sources */, - 350600110EA7FCDF0085CBDF /* NSData+Additions.m in Sources */, 239D501C0EA691AC00318802 /* AddDogViewController.m in Sources */, 239D501E0EA691AC00318802 /* ObjectiveResource+XMLSerializableSupport.m in Sources */, 239D501F0EA691AC00318802 /* ObjectiveResource.m in Sources */, 239D50200EA691AC00318802 /* Connection.m in Sources */, - 239D50210EA691AC00318802 /* FromXMLElementDelegate.m in Sources */, - 239D50220EA691AC00318802 /* NSArray+XMLSerializableSupport.m in Sources */, - 239D50230EA691AC00318802 /* NSDate+XMLSerializableSupport.m in Sources */, - 239D50240EA691AC00318802 /* NSDictionary+XMLSerializableSupport.m in Sources */, - 239D50250EA691AC00318802 /* NSNull+XMLSerializableSupport.m in Sources */, - 239D50260EA691AC00318802 /* NSObject+PropertySupport.m in Sources */, - 239D50270EA691AC00318802 /* NSObject+XMLSerializableSupport.m in Sources */, - 239D50280EA691AC00318802 /* NSString+GSub.m in Sources */, - 239D50290EA691AC00318802 /* NSString+InflectionSupport.m in Sources */, 239D502A0EA691AC00318802 /* Response.m in Sources */, 239D502B0EA691AC00318802 /* EditDogViewController.m in Sources */, 239D502C0EA691AC00318802 /* ViewDogController.m in Sources */, @@ -634,22 +616,32 @@ 239D50010EA690E600318802 /* GTMIPhoneUnitTestDelegate.m in Sources */, 239D50020EA690E600318802 /* GTMIPhoneUnitTestMain.m in Sources */, 239D50DA0EA6921800318802 /* DogTest.m in Sources */, - 239D75CE0EAF8D3700664953 /* ObjectiveResourceDateFormatter.m in Sources */, 2377C4F60F019E67006E155F /* NSHTTPURLResponse+Error.m in Sources */, 23B4A6420F092B620021AB9D /* DogErrorTest.m in Sources */, - 23F71FFC0F13FDFC009C7C2E /* NSString+XMLSerializableSupport.m in Sources */, - 3520BE860F16482800BEF309 /* NSObject+JSONSerializableSupport.m in Sources */, - 23E62A930F2011070083A66B /* NSDictionary+JSONSerializableSupport.m in Sources */, - 23E62A9A0F2013B90083A66B /* NSDictionary+KeyTranslation.m in Sources */, 23C922810F24FED700EDE8AF /* ObjectiveResource+JSONSerializableSupport.m in Sources */, 23C922F30F25066900EDE8AF /* NSMutableURLRequest+ResponseType.m in Sources */, - 239AC9D20F2574EA00F5B672 /* NSObject+Serialize.m in Sources */, - 239ACA150F25789700F5B672 /* NSDate+Serialize.m in Sources */, - 239ACA3E0F2579D000F5B672 /* NSString+Serialize.m in Sources */, 35CA32660F1E67A1001513AA /* ConnectionDelegate.m in Sources */, - 35C6753F0F2E020B005FF6CE /* NSObject+SBJSON.m in Sources */, - 35C675400F2E020B005FF6CE /* NSString+SBJSON.m in Sources */, - 35C675410F2E020B005FF6CE /* SBJSON.m in Sources */, + 35C679450F2E70C2005FF6CE /* NSString+InflectionSupport.m in Sources */, + 35C679460F2E70C2005FF6CE /* NSData+Additions.m in Sources */, + 35C679470F2E70C2005FF6CE /* NSObject+PropertySupport.m in Sources */, + 35C679480F2E70C2005FF6CE /* NSString+GSub.m in Sources */, + 35C679490F2E70C2005FF6CE /* ObjectiveResourceDateFormatter.m in Sources */, + 35C6794A0F2E70C2005FF6CE /* NSObject+SBJSON.m in Sources */, + 35C6794B0F2E70C2005FF6CE /* NSString+SBJSON.m in Sources */, + 35C6794C0F2E70C2005FF6CE /* SBJSON.m in Sources */, + 35C6794D0F2E70C2005FF6CE /* NSDictionary+JSONSerializableSupport.m in Sources */, + 35C6794E0F2E70C2005FF6CE /* NSObject+JSONSerializableSupport.m in Sources */, + 35C6794F0F2E70C2005FF6CE /* NSDate+Serialize.m in Sources */, + 35C679500F2E70C2005FF6CE /* NSDictionary+KeyTranslation.m in Sources */, + 35C679510F2E70C2005FF6CE /* NSObject+Serialize.m in Sources */, + 35C679520F2E70C2005FF6CE /* NSString+Serialize.m in Sources */, + 35C679530F2E70C2005FF6CE /* FromXMLElementDelegate.m in Sources */, + 35C679540F2E70C2005FF6CE /* NSArray+XMLSerializableSupport.m in Sources */, + 35C679550F2E70C2005FF6CE /* NSDate+XMLSerializableSupport.m in Sources */, + 35C679560F2E70C2005FF6CE /* NSDictionary+XMLSerializableSupport.m in Sources */, + 35C679570F2E70C2005FF6CE /* NSNull+XMLSerializableSupport.m in Sources */, + 35C679580F2E70C2005FF6CE /* NSObject+XMLSerializableSupport.m in Sources */, + 35C679590F2E70C2005FF6CE /* NSString+XMLSerializableSupport.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };