From 34b33880fb46a342b29e8e0b9e22cc3982b897f1 Mon Sep 17 00:00:00 2001 From: dob Date: Thu, 10 Mar 2011 16:58:59 +0100 Subject: [PATCH 01/16] Add TouchCode Library --- .../Vendors/TouchJSON/CDataScanner.h | 71 ++ .../Vendors/TouchJSON/CDataScanner.m | 340 +++++++++ .../Experimental/CFilteringJSONSerializer.h | 25 + .../Experimental/CFilteringJSONSerializer.m | 87 +++ .../CJSONDeserializer_BlocksExtensions.h | 16 + .../CJSONDeserializer_BlocksExtensions.m | 63 ++ .../Experimental/CJSONSerialization.h | 34 + .../Experimental/CJSONSerialization.m | 59 ++ .../Experimental/CJSONSerializedData.h | 25 + .../Experimental/CJSONSerializedData.m | 42 ++ .../Extensions/CDataScanner_Extensions.h | 40 ++ .../Extensions/CDataScanner_Extensions.m | 135 ++++ .../Extensions/NSDictionary_JSONExtensions.h | 37 + .../Extensions/NSDictionary_JSONExtensions.m | 47 ++ .../TouchJSON/JSON/CJSONDeserializer.h | 63 ++ .../TouchJSON/JSON/CJSONDeserializer.m | 161 +++++ .../Vendors/TouchJSON/JSON/CJSONScanner.h | 95 +++ .../Vendors/TouchJSON/JSON/CJSONScanner.m | 676 ++++++++++++++++++ .../Vendors/TouchJSON/JSON/CJSONSerializer.h | 53 ++ .../Vendors/TouchJSON/JSON/CJSONSerializer.m | 342 +++++++++ .../TouchJSON/JSON/JSONRepresentation.h | 18 + 21 files changed, 2429 insertions(+) create mode 100644 src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m create mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h diff --git a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h new file mode 100644 index 0000000000..41f68e882c --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h @@ -0,0 +1,71 @@ +// +// CDataScanner.h +// TouchCode +// +// Created by Jonathan Wight on 04/16/08. +// Copyright 2008 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import + +// NSScanner + +@interface CDataScanner : NSObject { + NSData *data; + + u_int8_t *start; + u_int8_t *end; + u_int8_t *current; + NSUInteger length; +} + +@property (readwrite, nonatomic, retain) NSData *data; +@property (readwrite, nonatomic, assign) NSUInteger scanLocation; +@property (readonly, nonatomic, assign) NSUInteger bytesRemaining; +@property (readonly, nonatomic, assign) BOOL isAtEnd; + +- (id)initWithData:(NSData *)inData; + +- (unichar)currentCharacter; +- (unichar)scanCharacter; +- (BOOL)scanCharacter:(unichar)inCharacter; + +- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue; +- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue; +- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters + +- (BOOL)scanUpToString:(NSString *)string intoString:(NSString **)outValue; +- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters + +- (BOOL)scanNumber:(NSNumber **)outValue; +- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue; + +- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData; + +- (void)skipWhitespace; + +- (NSString *)remainingString; +- (NSData *)remainingData; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m new file mode 100644 index 0000000000..b3cee6fec8 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m @@ -0,0 +1,340 @@ +// +// CDataScanner.m +// TouchCode +// +// Created by Jonathan Wight on 04/16/08. +// Copyright 2008 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CDataScanner.h" + +#import "CDataScanner_Extensions.h" + +@interface CDataScanner () +@end + +#pragma mark - + +inline static unichar CharacterAtPointer(void *start, void *end) + { + #pragma unused(end) + + const u_int8_t theByte = *(u_int8_t *)start; + if (theByte & 0x80) + { + // TODO -- UNICODE!!!! (well in theory nothing todo here) + } + const unichar theCharacter = theByte; + return(theCharacter); + } + + static NSCharacterSet *sDoubleCharacters = NULL; + + @implementation CDataScanner + +- (id)init + { + if ((self = [super init]) != NULL) + { + } + return(self); + } + +- (id)initWithData:(NSData *)inData; + { + if ((self = [self init]) != NULL) + { + [self setData:inData]; + } + return(self); + } + + + (void)initialize + { + if (sDoubleCharacters == NULL) + { + sDoubleCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789eE-+."] retain]; + } + } + +- (void)dealloc + { + [data release]; + data = NULL; + // + [super dealloc]; + } + +- (NSUInteger)scanLocation + { + return(current - start); + } + +- (NSUInteger)bytesRemaining + { + return(end - current); + } + +- (NSData *)data + { + return(data); + } + +- (void)setData:(NSData *)inData + { + if (data != inData) + { + [data release]; + data = [inData retain]; + } + + if (data) + { + start = (u_int8_t *)data.bytes; + end = start + data.length; + current = start; + length = data.length; + } + else + { + start = NULL; + end = NULL; + current = NULL; + length = 0; + } + } + +- (void)setScanLocation:(NSUInteger)inScanLocation + { + current = start + inScanLocation; + } + +- (BOOL)isAtEnd + { + return(self.scanLocation >= length); + } + +- (unichar)currentCharacter + { + return(CharacterAtPointer(current, end)); + } + +#pragma mark - + +- (unichar)scanCharacter + { + const unichar theCharacter = CharacterAtPointer(current++, end); + return(theCharacter); + } + +- (BOOL)scanCharacter:(unichar)inCharacter + { + unichar theCharacter = CharacterAtPointer(current, end); + if (theCharacter == inCharacter) + { + ++current; + return(YES); + } + else + return(NO); + } + +- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue + { + const size_t theLength = strlen(inString); + if ((size_t)(end - current) < theLength) + return(NO); + if (strncmp((char *)current, inString, theLength) == 0) + { + current += theLength; + if (outValue) + *outValue = [NSString stringWithUTF8String:inString]; + return(YES); + } + return(NO); + } + +- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue + { + if ((size_t)(end - current) < inString.length) + return(NO); + if (strncmp((char *)current, [inString UTF8String], inString.length) == 0) + { + current += inString.length; + if (outValue) + *outValue = inString; + return(YES); + } + return(NO); + } + +- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue + { + u_int8_t *P; + for (P = current; P < end && [inSet characterIsMember:*P] == YES; ++P) + ; + + if (P == current) + { + return(NO); + } + + if (outValue) + { + *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; + } + + current = P; + + return(YES); + } + +- (BOOL)scanUpToString:(NSString *)inString intoString:(NSString **)outValue + { + const char *theToken = [inString UTF8String]; + const char *theResult = strnstr((char *)current, theToken, end - current); + if (theResult == NULL) + { + return(NO); + } + + if (outValue) + { + *outValue = [[[NSString alloc] initWithBytes:current length:theResult - (char *)current encoding:NSUTF8StringEncoding] autorelease]; + } + + current = (u_int8_t *)theResult; + + return(YES); + } + +- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue + { + u_int8_t *P; + for (P = current; P < end && [inSet characterIsMember:*P] == NO; ++P) + ; + + if (P == current) + { + return(NO); + } + + if (outValue) + { + *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; + } + + current = P; + + return(YES); + } + +- (BOOL)scanNumber:(NSNumber **)outValue + { + NSString *theString = NULL; + if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString]) + { + if ([theString rangeOfString:@"."].location != NSNotFound) + { + if (outValue) + { + *outValue = [NSDecimalNumber decimalNumberWithString:theString]; + } + return(YES); + } + else if ([theString rangeOfString:@"-"].location != NSNotFound) + { + if (outValue != NULL) + { + *outValue = [NSNumber numberWithLongLong:[theString longLongValue]]; + } + return(YES); + } + else + { + if (outValue != NULL) + { + *outValue = [NSNumber numberWithUnsignedLongLong:strtoull([theString UTF8String], NULL, 0)]; + } + return(YES); + } + + } + return(NO); + } + +- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue; + { + NSString *theString = NULL; + if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString]) + { + if (outValue) + { + *outValue = [NSDecimalNumber decimalNumberWithString:theString]; + } + return(YES); + } + return(NO); + } + +- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData; + { + if (self.bytesRemaining < inLength) + { + return(NO); + } + + if (outData) + { + *outData = [NSData dataWithBytes:current length:inLength]; + } + + current += inLength; + return(YES); + } + + +- (void)skipWhitespace + { + u_int8_t *P; + for (P = current; P < end && (isspace(*P)); ++P) + ; + + current = P; + } + +- (NSString *)remainingString + { + NSData *theRemainingData = [NSData dataWithBytes:current length:end - current]; + NSString *theString = [[[NSString alloc] initWithData:theRemainingData encoding:NSUTF8StringEncoding] autorelease]; + return(theString); + } + +- (NSData *)remainingData; + { + NSData *theRemainingData = [NSData dataWithBytes:current length:end - current]; + return(theRemainingData); + } + + @end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h new file mode 100644 index 0000000000..f004a79c5f --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h @@ -0,0 +1,25 @@ +// +// CFilteringJSONSerializer.h +// CouchNotes +// +// Created by Jonathan Wight on 06/20/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import "CJSONSerializer.h" + +typedef NSString *(^JSONConversionTest)(id inObject); +typedef id (^JSONConversionConverter)(id inObject); // TODO replace with value transformers. + +@interface CFilteringJSONSerializer : CJSONSerializer { + NSSet *tests; + NSDictionary *convertersByName; +} + +@property (readwrite, nonatomic, retain) NSSet *tests; +@property (readwrite, nonatomic, retain) NSDictionary *convertersByName; + +- (void)addTest:(JSONConversionTest)inTest; +- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m new file mode 100644 index 0000000000..1ee2a3dd68 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m @@ -0,0 +1,87 @@ +// +// CFilteringJSONSerializer.m +// CouchNotes +// +// Created by Jonathan Wight on 06/20/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import "CFilteringJSONSerializer.h" + +@implementation CFilteringJSONSerializer + +@synthesize tests; +@synthesize convertersByName; + +- (void)dealloc + { + [tests release]; + tests = NULL; + // + [convertersByName release]; + convertersByName = NULL; + // + [super dealloc]; + } + +- (NSData *)serializeObject:(id)inObject error:(NSError **)outError + { + NSData *theData = NULL; + for (JSONConversionTest theTest in self.tests) + { + NSString *theName = theTest(inObject); + if (theName != NULL) + { + id theObject = NULL; + JSONConversionConverter theConverter = [self.convertersByName objectForKey:theName]; + if (theConverter) + { + theObject = theConverter(inObject); + } + + if (theObject) + { + if ([theObject isKindOfClass:[NSData class]]) + { + theData = theObject; + break; + } + else + { + NSError *theError = NULL; + theData = [super serializeObject:theObject error:&theError]; + if (theData != NULL) + { + break; + } + } + } + } + } + + if (theData == NULL) + { + theData = [super serializeObject:inObject error:outError]; + } + + return(theData); + } + +- (void)addTest:(JSONConversionTest)inTest + { + inTest = [[inTest copy] autorelease]; + NSSet *theTests = [self.tests setByAddingObject:inTest]; + self.tests = theTests; + } + +- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName + { + NSMutableDictionary *theConvertersByName = [[self.convertersByName mutableCopy] autorelease]; + + inConverter = [[inConverter copy] autorelease]; + [theConvertersByName setObject:inConverter forKey:inName]; + self.convertersByName = theConvertersByName; + } + + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h new file mode 100644 index 0000000000..17631af12f --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h @@ -0,0 +1,16 @@ +// +// CJSONDeserializer_BlocksExtensions.h +// TouchJSON +// +// Created by Jonathan Wight on 10/15/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import "CJSONDeserializer.h" + +@interface CJSONDeserializer (CJSONDeserializer_BlocksExtensions) + +- (void)deserializeAsDictionary:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block; +- (void)deserializeAsArray:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m new file mode 100644 index 0000000000..7ea774c435 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m @@ -0,0 +1,63 @@ +// +// CJSONDeserializer_BlocksExtensions.m +// TouchJSON +// +// Created by Jonathan Wight on 10/15/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import "CJSONDeserializer_BlocksExtensions.h" + +#import "CJSONScanner.h" + +@implementation CJSONDeserializer (CJSONDeserializer_BlocksExtensions) + +- (void)deserializeAsDictionary:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block { + + NSError *noDataError = nil; + if (inData == NULL || [inData length] == 0) { + noDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; + block(nil, noDataError); + } + + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + + NSError *deserializationError = nil; + self.scanner.data = inData; + NSDictionary *theDictionary = NULL; + BOOL successful = [self.scanner scanJSONDictionary:&theDictionary error:&deserializationError]; + + dispatch_async(dispatch_get_main_queue (), ^{ + if (successful) + block(theDictionary, nil); + else + block(nil, deserializationError); + }); + }]; +} + +- (void)deserializeAsArray:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block { + + NSError *nullInDataError = nil; + if (inData == NULL || [inData length] == 0) { + nullInDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; + block(nil, nullInDataError); + } + + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + + NSError *deserializationError = nil; + self.scanner.data = inData; + NSArray *theArray = NULL; + BOOL successful = [self.scanner scanJSONArray:&theArray error:&deserializationError]; + + dispatch_async(dispatch_get_main_queue(), ^{ + if (successful) + block(theArray, nil); + else + block(nil, deserializationError); + }); + }]; +} + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h new file mode 100644 index 0000000000..83c9bb2bf4 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h @@ -0,0 +1,34 @@ +// +// CJSONSerialization.h +// TouchJSON +// +// Created by Jonathan Wight on 03/04/11. +// Copyright 2011 toxicsoftware.com. All rights reserved. +// + +#import + +enum { + kCJSONReadingMutableContainers = 0x1, + kCJSONReadingMutableLeaves = 0x2, + kCJSONReadingAllowFragments = 0x04, +}; +typedef NSUInteger EJSONReadingOptions; + +enum { + kCJJSONWritingPrettyPrinted = 0x1 +}; +typedef NSUInteger EJSONWritingOptions; + + +@interface CJSONSerialization : NSObject { + +} + ++ (BOOL)isValidJSONObject:(id)obj; ++ (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error; ++ (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error; ++ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error; ++ (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m new file mode 100644 index 0000000000..5f603f6c3c --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m @@ -0,0 +1,59 @@ +// +// CJSONSerialization.m +// TouchJSON +// +// Created by Jonathan Wight on 03/04/11. +// Copyright 2011 toxicsoftware.com. All rights reserved. +// + +#import "CJSONSerialization.h" + +#import "CJSONDeserializer.h" +#import "CJSONSerializer.h" + +@implementation CJSONSerialization + ++ (BOOL)isValidJSONObject:(id)obj + { + CJSONSerializer *theSerializer = [CJSONSerializer serializer]; + return([theSerializer isValidJSONObject:obj]); + } + ++ (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error + { + #pragma unused (opt) + + CJSONSerializer *theSerializer = [CJSONSerializer serializer]; + NSData *theData = [theSerializer serializeObject:obj error:error]; + return(theData); + } + ++ (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error + { + CJSONDeserializer *theDeserializer = [CJSONDeserializer deserializer]; + theDeserializer.options = (opt & kCJSONReadingMutableContainers ? 0 : kJSONDeserializationOptions_MutableContainers) + | (opt & kCJSONReadingMutableLeaves ? 0 : kJSONDeserializationOptions_MutableLeaves); + id theObject = [theDeserializer deserialize:data error:error]; + return(theObject); + } + ++ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error + { + // TODO -- this is a quick work around. + NSInteger theSize = -1; + NSData *theData = [self dataWithJSONObject:obj options:opt error:error]; + if (theData) + { + theSize = [stream write:[theData bytes] maxLength:[theData length]]; + } + return(theSize); + } + ++ (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error + { + #pragma unused (stream, opt, error) + // TODO -- how much to read? Ugh. + return(NULL); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h new file mode 100644 index 0000000000..4bba1be220 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h @@ -0,0 +1,25 @@ +// +// CJSONSerializedData.h +// TouchMetricsTest +// +// Created by Jonathan Wight on 10/31/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import + +@protocol CJSONSerializable +@property (readonly, nonatomic, retain) NSData *serializedJSONData; +@end + +#pragma mark - + +@interface CJSONSerializedData : NSObject { + NSData *data; +} + +@property (readonly, nonatomic, retain) NSData *data; + +- (id)initWithData:(NSData *)inData; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m new file mode 100644 index 0000000000..881899dcb6 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m @@ -0,0 +1,42 @@ +// +// CJSONSerializedData.m +// TouchMetricsTest +// +// Created by Jonathan Wight on 10/31/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import "CJSONSerializedData.h" + +@interface CJSONSerializedData () +@end + +#pragma mark - + +@implementation CJSONSerializedData + +@synthesize data; + +- (id)initWithData:(NSData *)inData + { + if ((self = [super init]) != NULL) + { + data = [inData retain]; + } + return(self); + } + +- (void)dealloc + { + [data release]; + data = NULL; + // + [super dealloc]; + } + +- (NSData *)serializedJSONData + { + return(self.data); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h new file mode 100644 index 0000000000..cde1dbba97 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h @@ -0,0 +1,40 @@ +// +// CDataScanner_Extensions.h +// TouchCode +// +// Created by Jonathan Wight on 12/08/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CDataScanner.h" + +@interface CDataScanner (CDataScanner_Extensions) + +- (BOOL)scanCStyleComment:(NSString **)outComment; +- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment; + +- (NSUInteger)lineOfScanLocation; +- (NSDictionary *)userInfoForScanLocation; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m new file mode 100644 index 0000000000..90dbbdaffd --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m @@ -0,0 +1,135 @@ +// +// CDataScanner_Extensions.m +// TouchCode +// +// Created by Jonathan Wight on 12/08/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CDataScanner_Extensions.h" + +#define LF 0x000a // Line Feed +#define FF 0x000c // Form Feed +#define CR 0x000d // Carriage Return +#define NEL 0x0085 // Next Line +#define LS 0x2028 // Line Separator +#define PS 0x2029 // Paragraph Separator + +@implementation CDataScanner (CDataScanner_Extensions) + +- (BOOL)scanCStyleComment:(NSString **)outComment +{ +if ([self scanString:@"/*" intoString:NULL] == YES) + { + NSString *theComment = NULL; + if ([self scanUpToString:@"*/" intoString:&theComment] == NO) + [NSException raise:NSGenericException format:@"Started to scan a C style comment but it wasn't terminated."]; + + if ([theComment rangeOfString:@"/*"].location != NSNotFound) + [NSException raise:NSGenericException format:@"C style comments should not be nested."]; + + if ([self scanString:@"*/" intoString:NULL] == NO) + [NSException raise:NSGenericException format:@"C style comment did not end correctly."]; + + if (outComment != NULL) + *outComment = theComment; + + return(YES); + } +else + { + return(NO); + } +} + +- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment + { + if ([self scanString:@"//" intoString:NULL] == YES) + { + unichar theCharacters[] = { LF, FF, CR, NEL, LS, PS, }; + NSCharacterSet *theLineBreaksCharacterSet = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithCharacters:theCharacters length:sizeof(theCharacters) / sizeof(*theCharacters)]]; + + NSString *theComment = NULL; + [self scanUpToCharactersFromSet:theLineBreaksCharacterSet intoString:&theComment]; + [self scanCharactersFromSet:theLineBreaksCharacterSet intoString:NULL]; + + if (outComment != NULL) + *outComment = theComment; + + return(YES); + } + else + { + return(NO); + } + } + +- (NSUInteger)lineOfScanLocation + { + NSUInteger theLine = 0; + for (const u_int8_t *C = start; C < current; ++C) + { + // TODO: JIW What about MS-DOS line endings you bastard! (Also other unicode line endings) + if (*C == '\n' || *C == '\r') + { + ++theLine; + } + } + return(theLine); + } + +- (NSDictionary *)userInfoForScanLocation + { + NSUInteger theLine = 0; + const u_int8_t *theLineStart = start; + for (const u_int8_t *C = start; C < current; ++C) + { + if (*C == '\n' || *C == '\r') + { + theLineStart = C - 1; + ++theLine; + } + } + + NSUInteger theCharacter = current - theLineStart; + + NSRange theStartRange = NSIntersectionRange((NSRange){ .location = MAX((NSInteger)self.scanLocation - 20, 0), .length = 20 + (NSInteger)self.scanLocation - 20 }, (NSRange){ .location = 0, .length = self.data.length }); + NSRange theEndRange = NSIntersectionRange((NSRange){ .location = self.scanLocation, .length = 20 }, (NSRange){ .location = 0, .length = self.data.length }); + + + NSString *theSnippet = [NSString stringWithFormat:@"%@!HERE>!%@", + [[[NSString alloc] initWithData:[self.data subdataWithRange:theStartRange] encoding:NSUTF8StringEncoding] autorelease], + [[[NSString alloc] initWithData:[self.data subdataWithRange:theEndRange] encoding:NSUTF8StringEncoding] autorelease] + ]; + + NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithUnsignedInteger:theLine], @"line", + [NSNumber numberWithUnsignedInteger:theCharacter], @"character", + [NSNumber numberWithUnsignedInteger:self.scanLocation], @"location", + theSnippet, @"snippet", + NULL]; + return(theUserInfo); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h new file mode 100644 index 0000000000..6e611d0fe5 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h @@ -0,0 +1,37 @@ +// +// NSDictionary_JSONExtensions.h +// TouchCode +// +// Created by Jonathan Wight on 04/17/08. +// Copyright 2008 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import + +@interface NSDictionary (NSDictionary_JSONExtensions) + ++ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError; ++ (id)dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m new file mode 100644 index 0000000000..c0bb43cdb6 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m @@ -0,0 +1,47 @@ +// +// NSDictionary_JSONExtensions.m +// TouchCode +// +// Created by Jonathan Wight on 04/17/08. +// Copyright 2008 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "NSDictionary_JSONExtensions.h" + +#import "CJSONDeserializer.h" + +@implementation NSDictionary (NSDictionary_JSONExtensions) + ++ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError + { + return([[CJSONDeserializer deserializer] deserialize:inData error:outError]); + } + ++ (id)dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError; + { + NSData *theData = [inJSON dataUsingEncoding:NSUTF8StringEncoding]; + return([self dictionaryWithJSONData:theData error:outError]); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h new file mode 100644 index 0000000000..0c3ed027cd --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h @@ -0,0 +1,63 @@ +// +// CJSONDeserializer.h +// TouchCode +// +// Created by Jonathan Wight on 12/15/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import + +#import "CJSONScanner.h" + +extern NSString *const kJSONDeserializerErrorDomain /* = @"CJSONDeserializerErrorDomain" */; + +enum { + kJSONDeserializationOptions_MutableContainers = kJSONScannerOptions_MutableContainers, + kJSONDeserializationOptions_MutableLeaves = kJSONScannerOptions_MutableLeaves, +}; +typedef NSUInteger EJSONDeserializationOptions; + +@class CJSONScanner; + +@interface CJSONDeserializer : NSObject { + CJSONScanner *scanner; + EJSONDeserializationOptions options; +} + +@property (readwrite, nonatomic, retain) CJSONScanner *scanner; +/// Object to return instead when a null encountered in the JSON. Defaults to NSNull. Setting to null causes the scanner to skip null values. +@property (readwrite, nonatomic, retain) id nullObject; +/// JSON must be encoded in Unicode (UTF-8, UTF-16 or UTF-32). Use this if you expect to get the JSON in another encoding. +@property (readwrite, nonatomic, assign) NSStringEncoding allowedEncoding; +@property (readwrite, nonatomic, assign) EJSONDeserializationOptions options; + ++ (id)deserializer; + +- (id)deserialize:(NSData *)inData error:(NSError **)outError; + +- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError; +- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError; + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m new file mode 100644 index 0000000000..27a2d037de --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m @@ -0,0 +1,161 @@ +// +// CJSONDeserializer.m +// TouchCode +// +// Created by Jonathan Wight on 12/15/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CJSONDeserializer.h" + +#import "CJSONScanner.h" +#import "CDataScanner.h" + +NSString *const kJSONDeserializerErrorDomain = @"CJSONDeserializerErrorDomain"; + +@interface CJSONDeserializer () +@end + +@implementation CJSONDeserializer + +@synthesize scanner; +@synthesize options; + ++ (id)deserializer + { + return([[[self alloc] init] autorelease]); + } + +- (id)init + { + if ((self = [super init]) != NULL) + { + } + return(self); + } + +- (void)dealloc + { + [scanner release]; + scanner = NULL; + // + [super dealloc]; + } + +#pragma mark - + +- (CJSONScanner *)scanner + { + if (scanner == NULL) + { + scanner = [[CJSONScanner alloc] init]; + } + return(scanner); + } + +- (id)nullObject + { + return(self.scanner.nullObject); + } + +- (void)setNullObject:(id)inNullObject + { + self.scanner.nullObject = inNullObject; + } + +#pragma mark - + +- (NSStringEncoding)allowedEncoding + { + return(self.scanner.allowedEncoding); + } + +- (void)setAllowedEncoding:(NSStringEncoding)inAllowedEncoding + { + self.scanner.allowedEncoding = inAllowedEncoding; + } + +#pragma mark - + +- (id)deserialize:(NSData *)inData error:(NSError **)outError + { + if (inData == NULL || [inData length] == 0) + { + if (outError) + *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; + + return(NULL); + } + if ([self.scanner setData:inData error:outError] == NO) + { + return(NULL); + } + id theObject = NULL; + if ([self.scanner scanJSONObject:&theObject error:outError] == YES) + return(theObject); + else + return(NULL); + } + +- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError + { + if (inData == NULL || [inData length] == 0) + { + if (outError) + *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; + + return(NULL); + } + if ([self.scanner setData:inData error:outError] == NO) + { + return(NULL); + } + NSDictionary *theDictionary = NULL; + if ([self.scanner scanJSONDictionary:&theDictionary error:outError] == YES) + return(theDictionary); + else + return(NULL); + } + +- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError + { + if (inData == NULL || [inData length] == 0) + { + if (outError) + *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; + + return(NULL); + } + if ([self.scanner setData:inData error:outError] == NO) + { + return(NULL); + } + NSArray *theArray = NULL; + if ([self.scanner scanJSONArray:&theArray error:outError] == YES) + return(theArray); + else + return(NULL); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h new file mode 100644 index 0000000000..d410893f42 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h @@ -0,0 +1,95 @@ +// +// CJSONScanner.h +// TouchCode +// +// Created by Jonathan Wight on 12/07/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CDataScanner.h" + +enum { + kJSONScannerOptions_MutableContainers = 0x1, + kJSONScannerOptions_MutableLeaves = 0x2, +}; +typedef NSUInteger EJSONScannerOptions; + +/// CDataScanner subclass that understands JSON syntax natively. You should generally use CJSONDeserializer instead of this class. (TODO - this could have been a category?) +@interface CJSONScanner : CDataScanner { + BOOL strictEscapeCodes; + id nullObject; + NSStringEncoding allowedEncoding; + EJSONScannerOptions options; +} + +@property (readwrite, nonatomic, assign) BOOL strictEscapeCodes; +@property (readwrite, nonatomic, retain) id nullObject; +@property (readwrite, nonatomic, assign) NSStringEncoding allowedEncoding; +@property (readwrite, nonatomic, assign) EJSONScannerOptions options; + +- (BOOL)setData:(NSData *)inData error:(NSError **)outError; + +- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError; +- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError; +- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError; +- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError; +- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError; + +@end + +extern NSString *const kJSONScannerErrorDomain /* = @"kJSONScannerErrorDomain" */; + +typedef enum { + + // Fundamental scanning errors + kJSONScannerErrorCode_NothingToScan = -11, + kJSONScannerErrorCode_CouldNotDecodeData = -12, + kJSONScannerErrorCode_CouldNotSerializeData = -13, + kJSONScannerErrorCode_CouldNotSerializeObject = -14, + kJSONScannerErrorCode_CouldNotScanObject = -15, + + // Dictionary scanning + kJSONScannerErrorCode_DictionaryStartCharacterMissing = -101, + kJSONScannerErrorCode_DictionaryKeyScanFailed = -102, + kJSONScannerErrorCode_DictionaryKeyNotTerminated = -103, + kJSONScannerErrorCode_DictionaryValueScanFailed = -104, + kJSONScannerErrorCode_DictionaryKeyValuePairNoDelimiter = -105, + kJSONScannerErrorCode_DictionaryNotTerminated = -106, + + // Array scanning + kJSONScannerErrorCode_ArrayStartCharacterMissing = -201, + kJSONScannerErrorCode_ArrayValueScanFailed = -202, + kJSONScannerErrorCode_ArrayValueIsNull = -203, + kJSONScannerErrorCode_ArrayNotTerminated = -204, + + // String scanning + kJSONScannerErrorCode_StringNotStartedWithBackslash = -301, + kJSONScannerErrorCode_StringUnicodeNotDecoded = -302, + kJSONScannerErrorCode_StringUnknownEscapeCode = -303, + kJSONScannerErrorCode_StringNotTerminated = -304, + + // Number scanning + kJSONScannerErrorCode_NumberNotScannable = -401 + +} EJSONScannerErrorCode; diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m new file mode 100644 index 0000000000..c5ffeb4a11 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m @@ -0,0 +1,676 @@ +// +// CJSONScanner.m +// TouchCode +// +// Created by Jonathan Wight on 12/07/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CJSONScanner.h" + +#import "CDataScanner_Extensions.h" + +#if !defined(TREAT_COMMENTS_AS_WHITESPACE) +#define TREAT_COMMENTS_AS_WHITESPACE 0 +#endif // !defined(TREAT_COMMENTS_AS_WHITESPACE) + +NSString *const kJSONScannerErrorDomain = @"kJSONScannerErrorDomain"; + +inline static int HexToInt(char inCharacter) + { + int theValues[] = { 0x0 /* 48 '0' */, 0x1 /* 49 '1' */, 0x2 /* 50 '2' */, 0x3 /* 51 '3' */, 0x4 /* 52 '4' */, 0x5 /* 53 '5' */, 0x6 /* 54 '6' */, 0x7 /* 55 '7' */, 0x8 /* 56 '8' */, 0x9 /* 57 '9' */, -1 /* 58 ':' */, -1 /* 59 ';' */, -1 /* 60 '<' */, -1 /* 61 '=' */, -1 /* 62 '>' */, -1 /* 63 '?' */, -1 /* 64 '@' */, 0xa /* 65 'A' */, 0xb /* 66 'B' */, 0xc /* 67 'C' */, 0xd /* 68 'D' */, 0xe /* 69 'E' */, 0xf /* 70 'F' */, -1 /* 71 'G' */, -1 /* 72 'H' */, -1 /* 73 'I' */, -1 /* 74 'J' */, -1 /* 75 'K' */, -1 /* 76 'L' */, -1 /* 77 'M' */, -1 /* 78 'N' */, -1 /* 79 'O' */, -1 /* 80 'P' */, -1 /* 81 'Q' */, -1 /* 82 'R' */, -1 /* 83 'S' */, -1 /* 84 'T' */, -1 /* 85 'U' */, -1 /* 86 'V' */, -1 /* 87 'W' */, -1 /* 88 'X' */, -1 /* 89 'Y' */, -1 /* 90 'Z' */, -1 /* 91 '[' */, -1 /* 92 '\' */, -1 /* 93 ']' */, -1 /* 94 '^' */, -1 /* 95 '_' */, -1 /* 96 '`' */, 0xa /* 97 'a' */, 0xb /* 98 'b' */, 0xc /* 99 'c' */, 0xd /* 100 'd' */, 0xe /* 101 'e' */, 0xf /* 102 'f' */, }; + if (inCharacter >= '0' && inCharacter <= 'f') + return(theValues[inCharacter - '0']); + else + return(-1); + } + +@interface CJSONScanner () +- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue; +@end + +#pragma mark - + +@implementation CJSONScanner + +@synthesize strictEscapeCodes; +@synthesize nullObject; +@synthesize allowedEncoding; +@synthesize options; + +- (id)init + { + if ((self = [super init]) != NULL) + { + strictEscapeCodes = NO; + nullObject = [[NSNull null] retain]; + } + return(self); + } + +- (void)dealloc + { + [nullObject release]; + nullObject = NULL; + // + [super dealloc]; + } + +#pragma mark - + +- (BOOL)setData:(NSData *)inData error:(NSError **)outError; + { + NSData *theData = inData; + if (theData && theData.length >= 4) + { + // This code is lame, but it works. Because the first character of any JSON string will always be a (ascii) control character we can work out the Unicode encoding by the bit pattern. See section 3 of http://www.ietf.org/rfc/rfc4627.txt + const char *theChars = theData.bytes; + NSStringEncoding theEncoding = NSUTF8StringEncoding; + if (theChars[0] != 0 && theChars[1] == 0) + { + if (theChars[2] != 0 && theChars[3] == 0) + theEncoding = NSUTF16LittleEndianStringEncoding; + else if (theChars[2] == 0 && theChars[3] == 0) + theEncoding = NSUTF32LittleEndianStringEncoding; + } + else if (theChars[0] == 0 && theChars[2] == 0 && theChars[3] != 0) + { + if (theChars[1] == 0) + theEncoding = NSUTF32BigEndianStringEncoding; + else if (theChars[1] != 0) + theEncoding = NSUTF16BigEndianStringEncoding; + } + + NSString *theString = [[NSString alloc] initWithData:theData encoding:theEncoding]; + if (theString == NULL && self.allowedEncoding != 0) + { + theString = [[NSString alloc] initWithData:theData encoding:self.allowedEncoding]; + } + theData = [theString dataUsingEncoding:NSUTF8StringEncoding]; + [theString release]; + } + + if (theData) + { + [super setData:theData]; + return(YES); + } + else + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan data. Data wasn't encoded properly?", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_CouldNotDecodeData userInfo:theUserInfo]; + } + return(NO); + } + } + +- (void)setData:(NSData *)inData + { + [self setData:inData error:NULL]; + } + +#pragma mark - + +- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError + { + BOOL theResult = YES; + + [self skipWhitespace]; + + id theObject = NULL; + + const unichar C = [self currentCharacter]; + switch (C) + { + case 't': + if ([self scanUTF8String:"true" intoString:NULL]) + { + theObject = [NSNumber numberWithBool:YES]; + } + break; + case 'f': + if ([self scanUTF8String:"false" intoString:NULL]) + { + theObject = [NSNumber numberWithBool:NO]; + } + break; + case 'n': + if ([self scanUTF8String:"null" intoString:NULL]) + { + theObject = self.nullObject; + } + break; + case '\"': + case '\'': + theResult = [self scanJSONStringConstant:&theObject error:outError]; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + theResult = [self scanJSONNumberConstant:&theObject error:outError]; + break; + case '{': + theResult = [self scanJSONDictionary:&theObject error:outError]; + break; + case '[': + theResult = [self scanJSONArray:&theObject error:outError]; + break; + default: + theResult = NO; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan object. Character not a valid JSON character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_CouldNotScanObject userInfo:theUserInfo]; + } + break; + } + + if (outObject != NULL) + *outObject = theObject; + + return(theResult); + } + +- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError + { + NSUInteger theScanLocation = [self scanLocation]; + + [self skipWhitespace]; + + if ([self scanCharacter:'{'] == NO) + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Dictionary that does not start with '{' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryStartCharacterMissing userInfo:theUserInfo]; + } + return(NO); + } + + NSMutableDictionary *theDictionary = [[NSMutableDictionary alloc] init]; + + while ([self currentCharacter] != '}') + { + [self skipWhitespace]; + + if ([self currentCharacter] == '}') + break; + + NSString *theKey = NULL; + if ([self scanJSONStringConstant:&theKey error:outError] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Failed to scan a key.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyScanFailed userInfo:theUserInfo]; + } + [theDictionary release]; + return(NO); + } + + [self skipWhitespace]; + + if ([self scanCharacter:':'] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Key was not terminated with a ':' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyNotTerminated userInfo:theUserInfo]; + } + [theDictionary release]; + return(NO); + } + + id theValue = NULL; + if ([self scanJSONObject:&theValue error:outError] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Failed to scan a value.", NSLocalizedDescriptionKey, + NULL]; + + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryValueScanFailed userInfo:theUserInfo]; + } + [theDictionary release]; + return(NO); + } + + if (theValue == NULL && self.nullObject == NULL) + { + // If the value is a null and nullObject is also null then we're skipping this key/value pair. + } + else + { + [theDictionary setValue:theValue forKey:theKey]; + } + + [self skipWhitespace]; + if ([self scanCharacter:','] == NO) + { + if ([self currentCharacter] != '}') + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Key value pairs not delimited with a ',' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyValuePairNoDelimiter userInfo:theUserInfo]; + } + [theDictionary release]; + return(NO); + } + break; + } + else + { + [self skipWhitespace]; + if ([self currentCharacter] == '}') + break; + } + } + + if ([self scanCharacter:'}'] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan dictionary. Dictionary not terminated by a '}' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryNotTerminated userInfo:theUserInfo]; + } + [theDictionary release]; + return(NO); + } + + if (outDictionary != NULL) + { + if (self.options & kJSONScannerOptions_MutableContainers) + { + *outDictionary = [theDictionary autorelease]; + } + else + { + *outDictionary = [[theDictionary copy] autorelease]; + [theDictionary release]; + } + } + else + { + [theDictionary release]; + } + + return(YES); + } + +- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError + { + NSUInteger theScanLocation = [self scanLocation]; + + [self skipWhitespace]; + + if ([self scanCharacter:'['] == NO) + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan array. Array not started by a '[' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayStartCharacterMissing userInfo:theUserInfo]; + } + return(NO); + } + + NSMutableArray *theArray = [[NSMutableArray alloc] init]; + + [self skipWhitespace]; + while ([self currentCharacter] != ']') + { + NSString *theValue = NULL; + if ([self scanJSONObject:&theValue error:outError] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan array. Could not scan a value.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayValueScanFailed userInfo:theUserInfo]; + } + [theArray release]; + return(NO); + } + + if (theValue == NULL) + { + if (self.nullObject != NULL) + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan array. Value is NULL.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayValueIsNull userInfo:theUserInfo]; + } + [theArray release]; + return(NO); + } + } + else + { + [theArray addObject:theValue]; + } + + [self skipWhitespace]; + if ([self scanCharacter:','] == NO) + { + [self skipWhitespace]; + if ([self currentCharacter] != ']') + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayNotTerminated userInfo:theUserInfo]; + } + [theArray release]; + return(NO); + } + + break; + } + [self skipWhitespace]; + } + + [self skipWhitespace]; + + if ([self scanCharacter:']'] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayNotTerminated userInfo:theUserInfo]; + } + [theArray release]; + return(NO); + } + + if (outArray != NULL) + { + if (self.options & kJSONScannerOptions_MutableContainers) + { + *outArray = [theArray autorelease]; + } + else + { + *outArray = [[theArray copy] autorelease]; + [theArray release]; + } + } + else + { + [theArray release]; + } + return(YES); + } + +- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError + { + NSUInteger theScanLocation = [self scanLocation]; + + [self skipWhitespace]; + + NSMutableString *theString = [[NSMutableString alloc] init]; + + if ([self scanCharacter:'"'] == NO) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan string constant. String not started by a '\"' character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringNotStartedWithBackslash userInfo:theUserInfo]; + } + [theString release]; + return(NO); + } + + while ([self scanCharacter:'"'] == NO) + { + NSString *theStringChunk = NULL; + if ([self scanNotQuoteCharactersIntoString:&theStringChunk]) + { + CFStringAppend((CFMutableStringRef)theString, (CFStringRef)theStringChunk); + } + else if ([self scanCharacter:'\\'] == YES) + { + unichar theCharacter = [self scanCharacter]; + switch (theCharacter) + { + case '"': + case '\\': + case '/': + break; + case 'b': + theCharacter = '\b'; + break; + case 'f': + theCharacter = '\f'; + break; + case 'n': + theCharacter = '\n'; + break; + case 'r': + theCharacter = '\r'; + break; + case 't': + theCharacter = '\t'; + break; + case 'u': + { + theCharacter = 0; + + int theShift; + for (theShift = 12; theShift >= 0; theShift -= 4) + { + const int theDigit = HexToInt([self scanCharacter]); + if (theDigit == -1) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan string constant. Unicode character could not be decoded.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringUnicodeNotDecoded userInfo:theUserInfo]; + } + [theString release]; + return(NO); + } + theCharacter |= (theDigit << theShift); + } + } + break; + default: + { + if (strictEscapeCodes == YES) + { + [self setScanLocation:theScanLocation]; + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan string constant. Unknown escape code.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringUnknownEscapeCode userInfo:theUserInfo]; + } + [theString release]; + return(NO); + } + } + break; + } + CFStringAppendCharacters((CFMutableStringRef)theString, &theCharacter, 1); + } + else + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan string constant. No terminating double quote character.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringNotTerminated userInfo:theUserInfo]; + } + [theString release]; + return(NO); + } + } + + if (outStringConstant != NULL) + { + if (self.options & kJSONScannerOptions_MutableLeaves) + { + *outStringConstant = [theString autorelease]; + } + else + { + *outStringConstant = [[theString copy] autorelease]; + [theString release]; + } + } + else + { + [theString release]; + } + + return(YES); + } + +- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError + { + NSNumber *theNumber = NULL; + + [self skipWhitespace]; + + if ([self scanNumber:&theNumber] == YES) + { + if (outNumberConstant != NULL) + *outNumberConstant = theNumber; + return(YES); + } + else + { + if (outError) + { + NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: + @"Could not scan number constant.", NSLocalizedDescriptionKey, + NULL]; + [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; + *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_NumberNotScannable userInfo:theUserInfo]; + } + return(NO); + } + } + +#if TREAT_COMMENTS_AS_WHITESPACE +- (void)skipWhitespace + { + [super skipWhitespace]; + [self scanCStyleComment:NULL]; + [self scanCPlusPlusStyleComment:NULL]; + [super skipWhitespace]; + } +#endif // TREAT_COMMENTS_AS_WHITESPACE + +#pragma mark - + +- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue + { + u_int8_t *P; + for (P = current; P < end && *P != '\"' && *P != '\\'; ++P) + ; + + if (P == current) + { + return(NO); + } + + if (outValue) + { + *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; + } + + current = P; + + return(YES); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h new file mode 100644 index 0000000000..748a85c045 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h @@ -0,0 +1,53 @@ +// +// CJSONSerializer.h +// TouchCode +// +// Created by Jonathan Wight on 12/07/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import + +@interface CJSONSerializer : NSObject { +} + ++ (id)serializer; + +- (BOOL)isValidJSONObject:(id)inObject; + +/// Take any JSON compatible object (generally NSNull, NSNumber, NSString, NSArray and NSDictionary) and produce an NSData containing the serialized JSON. +- (NSData *)serializeObject:(id)inObject error:(NSError **)outError; + +- (NSData *)serializeNull:(NSNull *)inNull error:(NSError **)outError; +- (NSData *)serializeNumber:(NSNumber *)inNumber error:(NSError **)outError; +- (NSData *)serializeString:(NSString *)inString error:(NSError **)outError; +- (NSData *)serializeArray:(NSArray *)inArray error:(NSError **)outError; +- (NSData *)serializeDictionary:(NSDictionary *)inDictionary error:(NSError **)outError; + +@end + +typedef enum { + CJSONSerializerErrorCouldNotSerializeDataType = -1, + CJSONSerializerErrorCouldNotSerializeObject = -1 +} CJSONSerializerError; diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m new file mode 100644 index 0000000000..952b3c2cb2 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m @@ -0,0 +1,342 @@ +// +// CJSONSerializer.m +// TouchCode +// +// Created by Jonathan Wight on 12/07/2005. +// Copyright 2005 toxicsoftware.com. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "CJSONSerializer.h" + +#import "JSONRepresentation.h" + +static NSData *kNULL = NULL; +static NSData *kFalse = NULL; +static NSData *kTrue = NULL; + +@implementation CJSONSerializer + ++ (void)initialize + { + NSAutoreleasePool *thePool = [[NSAutoreleasePool alloc] init]; + + if (self == [CJSONSerializer class]) + { + if (kNULL == NULL) + kNULL = [[NSData alloc] initWithBytesNoCopy:(void *)"null" length:4 freeWhenDone:NO]; + if (kFalse == NULL) + kFalse = [[NSData alloc] initWithBytesNoCopy:(void *)"false" length:5 freeWhenDone:NO]; + if (kTrue == NULL) + kTrue = [[NSData alloc] initWithBytesNoCopy:(void *)"true" length:4 freeWhenDone:NO]; + + [thePool release]; + } + } + ++ (id)serializer + { + return([[[self alloc] init] autorelease]); + } + +- (BOOL)isValidJSONObject:(id)inObject + { + if ([inObject isKindOfClass:[NSNull class]]) + { + return(YES); + } + else if ([inObject isKindOfClass:[NSNumber class]]) + { + return(YES); + } + else if ([inObject isKindOfClass:[NSString class]]) + { + return(YES); + } + else if ([inObject isKindOfClass:[NSArray class]]) + { + return(YES); + } + else if ([inObject isKindOfClass:[NSDictionary class]]) + { + return(YES); + } + else if ([inObject isKindOfClass:[NSData class]]) + { + return(YES); + } + else if ([inObject respondsToSelector:@selector(JSONDataRepresentation)]) + { + return(YES); + } + else + { + return(NO); + } + } + +- (NSData *)serializeObject:(id)inObject error:(NSError **)outError + { + NSData *theResult = NULL; + + if ([inObject isKindOfClass:[NSNull class]]) + { + theResult = [self serializeNull:inObject error:outError]; + } + else if ([inObject isKindOfClass:[NSNumber class]]) + { + theResult = [self serializeNumber:inObject error:outError]; + } + else if ([inObject isKindOfClass:[NSString class]]) + { + theResult = [self serializeString:inObject error:outError]; + } + else if ([inObject isKindOfClass:[NSArray class]]) + { + theResult = [self serializeArray:inObject error:outError]; + } + else if ([inObject isKindOfClass:[NSDictionary class]]) + { + theResult = [self serializeDictionary:inObject error:outError]; + } + else if ([inObject isKindOfClass:[NSData class]]) + { + NSString *theString = [[[NSString alloc] initWithData:inObject encoding:NSUTF8StringEncoding] autorelease]; + theResult = [self serializeString:theString error:outError]; + } + else if ([inObject respondsToSelector:@selector(JSONDataRepresentation)]) + { + theResult = [inObject JSONDataRepresentation]; + } + else + { + if (outError) + { + NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: + [NSString stringWithFormat:@"Cannot serialize data of type '%@'", NSStringFromClass([inObject class])], NSLocalizedDescriptionKey, + NULL]; + *outError = [NSError errorWithDomain:@"TODO_DOMAIN" code:CJSONSerializerErrorCouldNotSerializeDataType userInfo:theUserInfo]; + } + return(NULL); + } + if (theResult == NULL) + { + if (outError) + { + NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: + [NSString stringWithFormat:@"Could not serialize object '%@'", inObject], NSLocalizedDescriptionKey, + NULL]; + *outError = [NSError errorWithDomain:@"TODO_DOMAIN" code:CJSONSerializerErrorCouldNotSerializeObject userInfo:theUserInfo]; + } + return(NULL); + } + return(theResult); + } + +- (NSData *)serializeNull:(NSNull *)inNull error:(NSError **)outError + { + #pragma unused (inNull, outError) + return(kNULL); + } + +- (NSData *)serializeNumber:(NSNumber *)inNumber error:(NSError **)outError + { + #pragma unused (outError) + NSData *theResult = NULL; + switch (CFNumberGetType((CFNumberRef)inNumber)) + { + case kCFNumberCharType: + { + int theValue = [inNumber intValue]; + if (theValue == 0) + theResult = kFalse; + else if (theValue == 1) + theResult = kTrue; + else + theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; + } + break; + case kCFNumberFloat32Type: + case kCFNumberFloat64Type: + case kCFNumberFloatType: + case kCFNumberDoubleType: + case kCFNumberSInt8Type: + case kCFNumberSInt16Type: + case kCFNumberSInt32Type: + case kCFNumberSInt64Type: + case kCFNumberShortType: + case kCFNumberIntType: + case kCFNumberLongType: + case kCFNumberLongLongType: + case kCFNumberCFIndexType: + default: + theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; + break; + } + return(theResult); + } + +- (NSData *)serializeString:(NSString *)inString error:(NSError **)outError + { + #pragma unused (outError) + + const char *theUTF8String = [inString UTF8String]; + + NSMutableData *theData = [NSMutableData dataWithLength:strlen(theUTF8String) * 2 + 2]; + + char *theOutputStart = [theData mutableBytes]; + char *OUT = theOutputStart; + + *OUT++ = '"'; + + for (const char *IN = theUTF8String; IN && *IN != '\0'; ++IN) + { + switch (*IN) + { + case '\\': + { + *OUT++ = '\\'; + *OUT++ = '\\'; + } + break; + case '\"': + { + *OUT++ = '\\'; + *OUT++ = '\"'; + } + break; + case '/': + { + *OUT++ = '\\'; + *OUT++ = '/'; + } + break; + case '\b': + { + *OUT++ = '\\'; + *OUT++ = 'b'; + } + break; + case '\f': + { + *OUT++ = '\\'; + *OUT++ = 'f'; + } + break; + case '\n': + { + *OUT++ = '\\'; + *OUT++ = 'n'; + } + break; + case '\r': + { + *OUT++ = '\\'; + *OUT++ = 'r'; + } + break; + case '\t': + { + *OUT++ = '\\'; + *OUT++ = 't'; + } + break; + default: + { + *OUT++ = *IN; + } + break; + } + } + + *OUT++ = '"'; + + theData.length = OUT - theOutputStart; + return(theData); + } + +- (NSData *)serializeArray:(NSArray *)inArray error:(NSError **)outError + { + NSMutableData *theData = [NSMutableData data]; + + [theData appendBytes:"[" length:1]; + + NSEnumerator *theEnumerator = [inArray objectEnumerator]; + id theValue = NULL; + NSUInteger i = 0; + while ((theValue = [theEnumerator nextObject]) != NULL) + { + NSData *theValueData = [self serializeObject:theValue error:outError]; + if (theValueData == NULL) + { + return(NULL); + } + [theData appendData:theValueData]; + if (++i < [inArray count]) + [theData appendBytes:"," length:1]; + } + + [theData appendBytes:"]" length:1]; + + return(theData); + } + +- (NSData *)serializeDictionary:(NSDictionary *)inDictionary error:(NSError **)outError + { + NSMutableData *theData = [NSMutableData data]; + + [theData appendBytes:"{" length:1]; + + NSArray *theKeys = [inDictionary allKeys]; + NSEnumerator *theEnumerator = [theKeys objectEnumerator]; + NSString *theKey = NULL; + while ((theKey = [theEnumerator nextObject]) != NULL) + { + id theValue = [inDictionary objectForKey:theKey]; + + NSData *theKeyData = [self serializeString:theKey error:outError]; + if (theKeyData == NULL) + { + return(NULL); + } + NSData *theValueData = [self serializeObject:theValue error:outError]; + if (theValueData == NULL) + { + return(NULL); + } + + + [theData appendData:theKeyData]; + [theData appendBytes:":" length:1]; + [theData appendData:theValueData]; + + if (theKey != [theKeys lastObject]) + [theData appendData:[@"," dataUsingEncoding:NSASCIIStringEncoding]]; + } + + [theData appendBytes:"}" length:1]; + + return(theData); + } + +@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h new file mode 100644 index 0000000000..a83d76fc88 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h @@ -0,0 +1,18 @@ +// +// JSONRepresentation.h +// TouchJSON +// +// Created by Jonathan Wight on 10/15/10. +// Copyright 2010 toxicsoftware.com. All rights reserved. +// + +#import + +@protocol JSONRepresentation + +@optional +- (id)initWithJSONDataRepresentation:(NSData *)inJSONData; + +- (NSData *)JSONDataRepresentation; + +@end From 75fefdefa577b9c37c6d4afa00bf365568c8f806 Mon Sep 17 00:00:00 2001 From: dob Date: Thu, 10 Mar 2011 17:01:22 +0100 Subject: [PATCH 02/16] Added TouchJSON library --- .../extThree20JSON+TouchJSON_Prefix.pch | 21 ++ src/extThree20JSON/Library+TouchJSON.xcconfig | 29 ++ src/extThree20JSON/Source/TTExtensionLoader.m | 3 + src/extThree20JSON/Source/TTURLJSONResponse.m | 7 + .../extThree20JSON.xcodeproj/project.pbxproj | 258 ++++++++++++++++++ 5 files changed, 318 insertions(+) create mode 100644 src/extThree20JSON/Headers/extThree20JSON+TouchJSON_Prefix.pch create mode 100644 src/extThree20JSON/Library+TouchJSON.xcconfig diff --git a/src/extThree20JSON/Headers/extThree20JSON+TouchJSON_Prefix.pch b/src/extThree20JSON/Headers/extThree20JSON+TouchJSON_Prefix.pch new file mode 100644 index 0000000000..4c2a9861a4 --- /dev/null +++ b/src/extThree20JSON/Headers/extThree20JSON+TouchJSON_Prefix.pch @@ -0,0 +1,21 @@ +// +// Copyright 2011 Dominic Böttger - Inspirationlabs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "../../common/Xcode324iOS41Fix.pch" + +#ifdef __OBJC__ + #import +#endif diff --git a/src/extThree20JSON/Library+TouchJSON.xcconfig b/src/extThree20JSON/Library+TouchJSON.xcconfig new file mode 100644 index 0000000000..21a132f666 --- /dev/null +++ b/src/extThree20JSON/Library+TouchJSON.xcconfig @@ -0,0 +1,29 @@ +// +// Copyright 2011 Dominic Böttger - Inspirationlabs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "../common/Configurations/Library.xcconfig" +#include "../common/Configurations/Libraries.xcconfig" + +BASE_PRODUCT_NAME = extThree20JSON +PRODUCT_NAME = $(BASE_PRODUCT_NAME)+TouchJSON +BUILD_LIBRARY_VERSION = 1.0 + +// We override these paths in order to copy the headers to the same directory, +// regardless of target. +PRIVATE_HEADERS_FOLDER_PATH = /../three20/$(BASE_PRODUCT_NAME)/private +PUBLIC_HEADERS_FOLDER_PATH = /../three20/$(BASE_PRODUCT_NAME) + +GCC_PREFIX_HEADER = $(SRCROOT)/Headers/$(BASE_PRODUCT_NAME)+TouchJSON_Prefix.pch diff --git a/src/extThree20JSON/Source/TTExtensionLoader.m b/src/extThree20JSON/Source/TTExtensionLoader.m index 16cb9966e8..3eb933af74 100644 --- a/src/extThree20JSON/Source/TTExtensionLoader.m +++ b/src/extThree20JSON/Source/TTExtensionLoader.m @@ -52,6 +52,9 @@ - (TTExtensionInfo*)extensionInfoNamedThree20JSON { #elif defined(EXTJSON_YAJL) extension.version = [extension.version stringByAppendingString:@" YAJL 1.0.11"]; extension.copyright = [extension.copyright stringByAppendingString:@" 2009 Gabriel Handford. 2010 Lloyd Hilaiel."]; +#elif defined(EXTJSON_TouchJSON) + extension.version = [extension.version stringByAppendingString:@" TouchJSON"]; + extension.copyright = [extension.copyright stringByAppendingString:@" 2008 Jonathan Wight"]; #endif return [extension autorelease]; diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index e3bc5938b8..a2b1ad32e0 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -22,6 +22,8 @@ #import "extThree20JSON/JSON.h" #elif defined(EXTJSON_YAJL) #import "extThree20JSON/NSObject+YAJL.h" +#elif defined(EXTJSON_TouchJSON) +#import "extThree20JSON/CJSONDeserializer.h" #endif // Core @@ -78,6 +80,11 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r code:kTTExtJSONErrorCodeInvalidJSON userInfo:[exception userInfo]]; } +#elif defined(EXTJSON_TouchJSON) + //NSString* json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + _rootObject = [[CJSONDeserializer deserializer] deserialize:data error:&err]; + NSLog(@"Root: %@", _rootObject); + //TT_RELEASE_SAFELY(json); #endif } diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 809018f4eb..408348edd9 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -66,6 +66,24 @@ 6E6462121187DD2F00F08CB1 /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6E6462131187DD3300F08CB1 /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6EB460DA1183D8CB00685649 /* libextThree20JSON+SBJSON.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */; }; + C6429F2F1327DCE30062B00C /* Library+TouchJSON.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */; }; + C6429F4C1327E0930062B00C /* TTURLJSONResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E645A1A11876C9800F08CB1 /* TTURLJSONResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6429F521327E0930062B00C /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6429F531327E0930062B00C /* TTErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 664B29E812848B1A0008D569 /* TTErrorCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6429F5E1327E0930062B00C /* TTExtensionLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6609982012939800007B1E07 /* TTExtensionLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6429F621327E0930062B00C /* TTURLJSONResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E645A1C11876C9800F08CB1 /* TTURLJSONResponse.m */; }; + C6429F701327E0930062B00C /* TTExtensionLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 66099817129397F5007B1E07 /* TTExtensionLoader.m */; }; + C6429F9C1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = C6429F9B1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch */; }; + C6CCA1BC13284C7300F27105 /* CDataScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CCA1801328466700F27105 /* CDataScanner.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6CCA1BD13284C7300F27105 /* CDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = C6CCA1811328466700F27105 /* CDataScanner.m */; }; + C6CCA1BE13284CC400F27105 /* TTErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 664B29EF12848B270008D569 /* TTErrorCodes.m */; }; + C6CCA1D513284E5700F27105 /* CJSONDeserializer.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CCA1911328466700F27105 /* CJSONDeserializer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6CCA1D613284E5700F27105 /* CJSONDeserializer.m in Sources */ = {isa = PBXBuildFile; fileRef = C6CCA1921328466700F27105 /* CJSONDeserializer.m */; }; + C6CCA1D713284E5700F27105 /* CJSONScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CCA1931328466700F27105 /* CJSONScanner.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6CCA1D813284E5700F27105 /* CJSONScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = C6CCA1941328466700F27105 /* CJSONScanner.m */; }; + C6CCA1D913284E5700F27105 /* CJSONSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CCA1951328466700F27105 /* CJSONSerializer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C6CCA1DA13284E5700F27105 /* CJSONSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = C6CCA1961328466700F27105 /* CJSONSerializer.m */; }; + C6CCA1DB13284E5700F27105 /* JSONRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CCA1971328466700F27105 /* JSONRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -146,6 +164,20 @@ remoteGlobalIDString = BEF31F390F352DF5000DE5D2; remoteInfo = extThree20JSON; }; + C6429F481327E0930062B00C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A6A11876D3F00F08CB1 /* Three20Core.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BEF31F390F352DF5000DE5D2; + remoteInfo = Three20Core; + }; + C6429F4A1327E0930062B00C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A7311876D4600F08CB1 /* Three20Network.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BEF31F390F352DF5000DE5D2; + remoteInfo = Three20Network; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -218,6 +250,30 @@ 6EB460921183D16000685649 /* UnitTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UnitTests-Info.plist"; path = "UnitTests/Resources/PropertyLists/UnitTests-Info.plist"; sourceTree = ""; }; 6EB460A61183D2AC00685649 /* UnitTests+SBJSON.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "UnitTests+SBJSON.xcconfig"; path = "Configurations/UnitTests+SBJSON.xcconfig"; sourceTree = ""; }; BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libextThree20JSON+SBJSON.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Library+TouchJSON.xcconfig"; sourceTree = ""; }; + C6429F771327E0930062B00C /* libextThree20JSON+TouchJSON.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libextThree20JSON+TouchJSON.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C6429F9B1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "extThree20JSON+TouchJSON_Prefix.pch"; path = "Headers/extThree20JSON+TouchJSON_Prefix.pch"; sourceTree = ""; }; + C6CCA1801328466700F27105 /* CDataScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner.h; sourceTree = ""; }; + C6CCA1811328466700F27105 /* CDataScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner.m; sourceTree = ""; }; + C6CCA1831328466700F27105 /* CFilteringJSONSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFilteringJSONSerializer.h; sourceTree = ""; }; + C6CCA1841328466700F27105 /* CFilteringJSONSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CFilteringJSONSerializer.m; sourceTree = ""; }; + C6CCA1851328466700F27105 /* CJSONDeserializer_BlocksExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONDeserializer_BlocksExtensions.h; sourceTree = ""; }; + C6CCA1861328466700F27105 /* CJSONDeserializer_BlocksExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONDeserializer_BlocksExtensions.m; sourceTree = ""; }; + C6CCA1871328466700F27105 /* CJSONSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerialization.h; sourceTree = ""; }; + C6CCA1881328466700F27105 /* CJSONSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerialization.m; sourceTree = ""; }; + C6CCA1891328466700F27105 /* CJSONSerializedData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerializedData.h; sourceTree = ""; }; + C6CCA18A1328466700F27105 /* CJSONSerializedData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerializedData.m; sourceTree = ""; }; + C6CCA18C1328466700F27105 /* CDataScanner_Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner_Extensions.h; sourceTree = ""; }; + C6CCA18D1328466700F27105 /* CDataScanner_Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner_Extensions.m; sourceTree = ""; }; + C6CCA18E1328466700F27105 /* NSDictionary_JSONExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDictionary_JSONExtensions.h; sourceTree = ""; }; + C6CCA18F1328466700F27105 /* NSDictionary_JSONExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionary_JSONExtensions.m; sourceTree = ""; }; + C6CCA1911328466700F27105 /* CJSONDeserializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONDeserializer.h; sourceTree = ""; }; + C6CCA1921328466700F27105 /* CJSONDeserializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONDeserializer.m; sourceTree = ""; }; + C6CCA1931328466700F27105 /* CJSONScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONScanner.h; sourceTree = ""; }; + C6CCA1941328466700F27105 /* CJSONScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONScanner.m; sourceTree = ""; }; + C6CCA1951328466700F27105 /* CJSONSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerializer.h; sourceTree = ""; }; + C6CCA1961328466700F27105 /* CJSONSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerializer.m; sourceTree = ""; }; + C6CCA1971328466700F27105 /* JSONRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONRepresentation.h; sourceTree = ""; }; EB9E6C6210B6A8F800DE563C /* extJSONUnitTests+SBJSON.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "extJSONUnitTests+SBJSON.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -236,6 +292,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6429F721327E0930062B00C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; EB9E6C5F10B6A8F800DE563C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -255,6 +318,7 @@ BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */, 6E645BD91187751200F08CB1 /* libextThree20JSON+YAJL.a */, EB9E6C6210B6A8F800DE563C /* extJSONUnitTests+SBJSON.octest */, + C6429F771327E0930062B00C /* libextThree20JSON+TouchJSON.a */, ); name = Products; sourceTree = ""; @@ -265,6 +329,7 @@ 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */, 6E645BF71187771D00F08CB1 /* extThree20JSON+SBJSON_Prefix.pch */, 6E645BF81187771D00F08CB1 /* extThree20JSON+YAJL_Prefix.pch */, + C6429F9B1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch */, 6609982012939800007B1E07 /* TTExtensionLoader.h */, 66099817129397F5007B1E07 /* TTExtensionLoader.m */, 6EB4609C1183D1E000685649 /* Source */, @@ -325,6 +390,7 @@ 6E645A1F11876CA800F08CB1 /* Vendors */ = { isa = PBXGroup; children = ( + C6CCA17F1328466700F27105 /* TouchJSON */, 6E645A2011876CA800F08CB1 /* SBJSON */, 6E645AF71187744C00F08CB1 /* YAJL */, ); @@ -446,10 +512,63 @@ 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */, 6E6454021184BDD500F08CB1 /* Project.xcconfig */, 6EB460A61183D2AC00685649 /* UnitTests+SBJSON.xcconfig */, + C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */, ); name = Configurations; sourceTree = ""; }; + C6CCA17F1328466700F27105 /* TouchJSON */ = { + isa = PBXGroup; + children = ( + C6CCA1801328466700F27105 /* CDataScanner.h */, + C6CCA1811328466700F27105 /* CDataScanner.m */, + C6CCA1821328466700F27105 /* Experimental */, + C6CCA18B1328466700F27105 /* Extensions */, + C6CCA1901328466700F27105 /* JSON */, + ); + path = TouchJSON; + sourceTree = ""; + }; + C6CCA1821328466700F27105 /* Experimental */ = { + isa = PBXGroup; + children = ( + C6CCA1831328466700F27105 /* CFilteringJSONSerializer.h */, + C6CCA1841328466700F27105 /* CFilteringJSONSerializer.m */, + C6CCA1851328466700F27105 /* CJSONDeserializer_BlocksExtensions.h */, + C6CCA1861328466700F27105 /* CJSONDeserializer_BlocksExtensions.m */, + C6CCA1871328466700F27105 /* CJSONSerialization.h */, + C6CCA1881328466700F27105 /* CJSONSerialization.m */, + C6CCA1891328466700F27105 /* CJSONSerializedData.h */, + C6CCA18A1328466700F27105 /* CJSONSerializedData.m */, + ); + path = Experimental; + sourceTree = ""; + }; + C6CCA18B1328466700F27105 /* Extensions */ = { + isa = PBXGroup; + children = ( + C6CCA18C1328466700F27105 /* CDataScanner_Extensions.h */, + C6CCA18D1328466700F27105 /* CDataScanner_Extensions.m */, + C6CCA18E1328466700F27105 /* NSDictionary_JSONExtensions.h */, + C6CCA18F1328466700F27105 /* NSDictionary_JSONExtensions.m */, + ); + path = Extensions; + sourceTree = ""; + }; + C6CCA1901328466700F27105 /* JSON */ = { + isa = PBXGroup; + children = ( + C6CCA1911328466700F27105 /* CJSONDeserializer.h */, + C6CCA1921328466700F27105 /* CJSONDeserializer.m */, + C6CCA1931328466700F27105 /* CJSONScanner.h */, + C6CCA1941328466700F27105 /* CJSONScanner.m */, + C6CCA1951328466700F27105 /* CJSONSerializer.h */, + C6CCA1961328466700F27105 /* CJSONSerializer.m */, + C6CCA1971328466700F27105 /* JSONRepresentation.h */, + ); + path = JSON; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -497,6 +616,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6429F4B1327E0930062B00C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C6CCA1D513284E5700F27105 /* CJSONDeserializer.h in Headers */, + C6CCA1D713284E5700F27105 /* CJSONScanner.h in Headers */, + C6CCA1D913284E5700F27105 /* CJSONSerializer.h in Headers */, + C6CCA1DB13284E5700F27105 /* JSONRepresentation.h in Headers */, + C6429F4C1327E0930062B00C /* TTURLJSONResponse.h in Headers */, + C6429F521327E0930062B00C /* extThree20JSON.h in Headers */, + C6429F531327E0930062B00C /* TTErrorCodes.h in Headers */, + C6429F5E1327E0930062B00C /* TTExtensionLoader.h in Headers */, + C6429F9C1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch in Headers */, + C6CCA1BC13284C7300F27105 /* CDataScanner.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -540,6 +676,26 @@ productReference = BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */; productType = "com.apple.product-type.library.static"; }; + C6429F461327E0930062B00C /* extThree20JSON+TouchJSON */ = { + isa = PBXNativeTarget; + buildConfigurationList = C6429F731327E0930062B00C /* Build configuration list for PBXNativeTarget "extThree20JSON+TouchJSON" */; + buildPhases = ( + C6429F4B1327E0930062B00C /* Headers */, + C6429F601327E0930062B00C /* Protect Copied Headers */, + C6429F611327E0930062B00C /* Sources */, + C6429F721327E0930062B00C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C6429F471327E0930062B00C /* PBXTargetDependency */, + C6429F491327E0930062B00C /* PBXTargetDependency */, + ); + name = "extThree20JSON+TouchJSON"; + productName = Three20; + productReference = C6429F771327E0930062B00C /* libextThree20JSON+TouchJSON.a */; + productType = "com.apple.product-type.library.static"; + }; EB9E6C6110B6A8F800DE563C /* extThree20JSONUnitTests+SBJSON */ = { isa = PBXNativeTarget; buildConfigurationList = EB9E6C6710B6A8F900DE563C /* Build configuration list for PBXNativeTarget "extThree20JSONUnitTests+SBJSON" */; @@ -596,6 +752,7 @@ BEF31F390F352DF5000DE5D2 /* extThree20JSON+SBJSON */, 6E645BA31187751200F08CB1 /* extThree20JSON+YAJL */, EB9E6C6110B6A8F800DE563C /* extThree20JSONUnitTests+SBJSON */, + C6429F461327E0930062B00C /* extThree20JSON+TouchJSON */, ); }; /* End PBXProject section */ @@ -636,6 +793,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + C6429F2F1327DCE30062B00C /* Library+TouchJSON.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -670,6 +828,20 @@ shellPath = "/bin/sh ../scripts/Protect.command"; shellScript = ""; }; + C6429F601327E0930062B00C /* Protect Copied Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Protect Copied Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/sh ../scripts/Protect.command"; + shellScript = ""; + }; EB9E6C6010B6A8F800DE563C /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -724,6 +896,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6429F611327E0930062B00C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6429F621327E0930062B00C /* TTURLJSONResponse.m in Sources */, + C6CCA1BE13284CC400F27105 /* TTErrorCodes.m in Sources */, + C6429F701327E0930062B00C /* TTExtensionLoader.m in Sources */, + C6CCA1BD13284C7300F27105 /* CDataScanner.m in Sources */, + C6CCA1D613284E5700F27105 /* CJSONDeserializer.m in Sources */, + C6CCA1D813284E5700F27105 /* CJSONScanner.m in Sources */, + C6CCA1DA13284E5700F27105 /* CJSONSerializer.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; EB9E6C5E10B6A8F800DE563C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -771,6 +957,16 @@ target = BEF31F390F352DF5000DE5D2 /* extThree20JSON+SBJSON */; targetProxy = 6EB460DD1183D8D400685649 /* PBXContainerItemProxy */; }; + C6429F471327E0930062B00C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Three20Core; + targetProxy = C6429F481327E0930062B00C /* PBXContainerItemProxy */; + }; + C6429F491327E0930062B00C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Three20Network; + targetProxy = C6429F4A1327E0930062B00C /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -927,6 +1123,58 @@ }; name = Release; }; + C6429F741327E0930062B00C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + EXTTHREE20JSONTOUCHJSON322_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+TouchJSON-Xcode3.2.2.a\""; + EXTTHREE20JSONTOUCHJSON325_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+TouchJSON-Xcode3.2.5.a\""; + EXTTHREE20JSONTOUCHJSON_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+SBJSON.a\""; + EXTTHREE20JSONYAJL322_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+YAJL-Xcode3.2.2.a\""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + DEBUG, + EXTJSON_TouchJSON, + ); + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C6429F751327E0930062B00C /* Internal */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + EXTJSON_YAJL, + DEBUG, + ); + PREBINDING = NO; + RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = iphoneos; + }; + name = Internal; + }; + C6429F761327E0930062B00C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_YAJL; + PREBINDING = NO; + SDKROOT = iphoneos; + ZERO_LINK = NO; + }; + name = Release; + }; EB9E6C6510B6A8F900DE563C /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 6EB460A61183D2AC00685649 /* UnitTests+SBJSON.xcconfig */; @@ -993,6 +1241,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C6429F731327E0930062B00C /* Build configuration list for PBXNativeTarget "extThree20JSON+TouchJSON" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6429F741327E0930062B00C /* Debug */, + C6429F751327E0930062B00C /* Internal */, + C6429F761327E0930062B00C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; EB9E6C6710B6A8F900DE563C /* Build configuration list for PBXNativeTarget "extThree20JSONUnitTests+SBJSON" */ = { isa = XCConfigurationList; buildConfigurations = ( From 374c7090dba85794df49865f8e9972a7de6f7fce Mon Sep 17 00:00:00 2001 From: dob Date: Thu, 10 Mar 2011 17:11:26 +0100 Subject: [PATCH 03/16] Removed the NSLog output --- src/extThree20JSON/Source/TTURLJSONResponse.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index a2b1ad32e0..41c6a5f74d 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -81,10 +81,7 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r userInfo:[exception userInfo]]; } #elif defined(EXTJSON_TouchJSON) - //NSString* json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; _rootObject = [[CJSONDeserializer deserializer] deserialize:data error:&err]; - NSLog(@"Root: %@", _rootObject); - //TT_RELEASE_SAFELY(json); #endif } From 9c147959258b2728fb2a95c3c73eb0f659168953 Mon Sep 17 00:00:00 2001 From: dob Date: Fri, 11 Mar 2011 01:16:39 +0100 Subject: [PATCH 04/16] Changed dealloc of the rootObject in TTURLJSONResponse for TouchJSON --- src/extThree20JSON/Source/TTURLJSONResponse.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index 41c6a5f74d..a9faf87d82 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -41,8 +41,9 @@ @implementation TTURLJSONResponse /////////////////////////////////////////////////////////////////////////////////////////////////// - (void)dealloc { +#ifndef EXTJSON_TouchJSON TT_RELEASE_SAFELY(_rootObject); - +#endif [super dealloc]; } From f30d641a0d0dfe88ed2696e6a12c2ec4f4acd5cb Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 20 Mar 2011 15:33:43 +0100 Subject: [PATCH 05/16] Removed TouchJSON --- .../Vendors/TouchJSON/CDataScanner.h | 71 -- .../Vendors/TouchJSON/CDataScanner.m | 340 --------- .../Experimental/CFilteringJSONSerializer.h | 25 - .../Experimental/CFilteringJSONSerializer.m | 87 --- .../CJSONDeserializer_BlocksExtensions.h | 16 - .../CJSONDeserializer_BlocksExtensions.m | 63 -- .../Experimental/CJSONSerialization.h | 34 - .../Experimental/CJSONSerialization.m | 59 -- .../Experimental/CJSONSerializedData.h | 25 - .../Experimental/CJSONSerializedData.m | 42 -- .../Extensions/CDataScanner_Extensions.h | 40 -- .../Extensions/CDataScanner_Extensions.m | 135 ---- .../Extensions/NSDictionary_JSONExtensions.h | 37 - .../Extensions/NSDictionary_JSONExtensions.m | 47 -- .../TouchJSON/JSON/CJSONDeserializer.h | 63 -- .../TouchJSON/JSON/CJSONDeserializer.m | 161 ----- .../Vendors/TouchJSON/JSON/CJSONScanner.h | 95 --- .../Vendors/TouchJSON/JSON/CJSONScanner.m | 676 ------------------ .../Vendors/TouchJSON/JSON/CJSONSerializer.h | 53 -- .../Vendors/TouchJSON/JSON/CJSONSerializer.m | 342 --------- .../TouchJSON/JSON/JSONRepresentation.h | 18 - 21 files changed, 2429 deletions(-) delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m delete mode 100644 src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h diff --git a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h deleted file mode 100644 index 41f68e882c..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// CDataScanner.h -// TouchCode -// -// Created by Jonathan Wight on 04/16/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -// NSScanner - -@interface CDataScanner : NSObject { - NSData *data; - - u_int8_t *start; - u_int8_t *end; - u_int8_t *current; - NSUInteger length; -} - -@property (readwrite, nonatomic, retain) NSData *data; -@property (readwrite, nonatomic, assign) NSUInteger scanLocation; -@property (readonly, nonatomic, assign) NSUInteger bytesRemaining; -@property (readonly, nonatomic, assign) BOOL isAtEnd; - -- (id)initWithData:(NSData *)inData; - -- (unichar)currentCharacter; -- (unichar)scanCharacter; -- (BOOL)scanCharacter:(unichar)inCharacter; - -- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue; -- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue; -- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters - -- (BOOL)scanUpToString:(NSString *)string intoString:(NSString **)outValue; -- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters - -- (BOOL)scanNumber:(NSNumber **)outValue; -- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue; - -- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData; - -- (void)skipWhitespace; - -- (NSString *)remainingString; -- (NSData *)remainingData; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m b/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m deleted file mode 100644 index b3cee6fec8..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/CDataScanner.m +++ /dev/null @@ -1,340 +0,0 @@ -// -// CDataScanner.m -// TouchCode -// -// Created by Jonathan Wight on 04/16/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -#import "CDataScanner_Extensions.h" - -@interface CDataScanner () -@end - -#pragma mark - - -inline static unichar CharacterAtPointer(void *start, void *end) - { - #pragma unused(end) - - const u_int8_t theByte = *(u_int8_t *)start; - if (theByte & 0x80) - { - // TODO -- UNICODE!!!! (well in theory nothing todo here) - } - const unichar theCharacter = theByte; - return(theCharacter); - } - - static NSCharacterSet *sDoubleCharacters = NULL; - - @implementation CDataScanner - -- (id)init - { - if ((self = [super init]) != NULL) - { - } - return(self); - } - -- (id)initWithData:(NSData *)inData; - { - if ((self = [self init]) != NULL) - { - [self setData:inData]; - } - return(self); - } - - + (void)initialize - { - if (sDoubleCharacters == NULL) - { - sDoubleCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789eE-+."] retain]; - } - } - -- (void)dealloc - { - [data release]; - data = NULL; - // - [super dealloc]; - } - -- (NSUInteger)scanLocation - { - return(current - start); - } - -- (NSUInteger)bytesRemaining - { - return(end - current); - } - -- (NSData *)data - { - return(data); - } - -- (void)setData:(NSData *)inData - { - if (data != inData) - { - [data release]; - data = [inData retain]; - } - - if (data) - { - start = (u_int8_t *)data.bytes; - end = start + data.length; - current = start; - length = data.length; - } - else - { - start = NULL; - end = NULL; - current = NULL; - length = 0; - } - } - -- (void)setScanLocation:(NSUInteger)inScanLocation - { - current = start + inScanLocation; - } - -- (BOOL)isAtEnd - { - return(self.scanLocation >= length); - } - -- (unichar)currentCharacter - { - return(CharacterAtPointer(current, end)); - } - -#pragma mark - - -- (unichar)scanCharacter - { - const unichar theCharacter = CharacterAtPointer(current++, end); - return(theCharacter); - } - -- (BOOL)scanCharacter:(unichar)inCharacter - { - unichar theCharacter = CharacterAtPointer(current, end); - if (theCharacter == inCharacter) - { - ++current; - return(YES); - } - else - return(NO); - } - -- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue - { - const size_t theLength = strlen(inString); - if ((size_t)(end - current) < theLength) - return(NO); - if (strncmp((char *)current, inString, theLength) == 0) - { - current += theLength; - if (outValue) - *outValue = [NSString stringWithUTF8String:inString]; - return(YES); - } - return(NO); - } - -- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue - { - if ((size_t)(end - current) < inString.length) - return(NO); - if (strncmp((char *)current, [inString UTF8String], inString.length) == 0) - { - current += inString.length; - if (outValue) - *outValue = inString; - return(YES); - } - return(NO); - } - -- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue - { - u_int8_t *P; - for (P = current; P < end && [inSet characterIsMember:*P] == YES; ++P) - ; - - if (P == current) - { - return(NO); - } - - if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - - current = P; - - return(YES); - } - -- (BOOL)scanUpToString:(NSString *)inString intoString:(NSString **)outValue - { - const char *theToken = [inString UTF8String]; - const char *theResult = strnstr((char *)current, theToken, end - current); - if (theResult == NULL) - { - return(NO); - } - - if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:theResult - (char *)current encoding:NSUTF8StringEncoding] autorelease]; - } - - current = (u_int8_t *)theResult; - - return(YES); - } - -- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue - { - u_int8_t *P; - for (P = current; P < end && [inSet characterIsMember:*P] == NO; ++P) - ; - - if (P == current) - { - return(NO); - } - - if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - - current = P; - - return(YES); - } - -- (BOOL)scanNumber:(NSNumber **)outValue - { - NSString *theString = NULL; - if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString]) - { - if ([theString rangeOfString:@"."].location != NSNotFound) - { - if (outValue) - { - *outValue = [NSDecimalNumber decimalNumberWithString:theString]; - } - return(YES); - } - else if ([theString rangeOfString:@"-"].location != NSNotFound) - { - if (outValue != NULL) - { - *outValue = [NSNumber numberWithLongLong:[theString longLongValue]]; - } - return(YES); - } - else - { - if (outValue != NULL) - { - *outValue = [NSNumber numberWithUnsignedLongLong:strtoull([theString UTF8String], NULL, 0)]; - } - return(YES); - } - - } - return(NO); - } - -- (BOOL)scanDecimalNumber:(NSDecimalNumber **)outValue; - { - NSString *theString = NULL; - if ([self scanCharactersFromSet:sDoubleCharacters intoString:&theString]) - { - if (outValue) - { - *outValue = [NSDecimalNumber decimalNumberWithString:theString]; - } - return(YES); - } - return(NO); - } - -- (BOOL)scanDataOfLength:(NSUInteger)inLength intoData:(NSData **)outData; - { - if (self.bytesRemaining < inLength) - { - return(NO); - } - - if (outData) - { - *outData = [NSData dataWithBytes:current length:inLength]; - } - - current += inLength; - return(YES); - } - - -- (void)skipWhitespace - { - u_int8_t *P; - for (P = current; P < end && (isspace(*P)); ++P) - ; - - current = P; - } - -- (NSString *)remainingString - { - NSData *theRemainingData = [NSData dataWithBytes:current length:end - current]; - NSString *theString = [[[NSString alloc] initWithData:theRemainingData encoding:NSUTF8StringEncoding] autorelease]; - return(theString); - } - -- (NSData *)remainingData; - { - NSData *theRemainingData = [NSData dataWithBytes:current length:end - current]; - return(theRemainingData); - } - - @end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h deleted file mode 100644 index f004a79c5f..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// CFilteringJSONSerializer.h -// CouchNotes -// -// Created by Jonathan Wight on 06/20/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import "CJSONSerializer.h" - -typedef NSString *(^JSONConversionTest)(id inObject); -typedef id (^JSONConversionConverter)(id inObject); // TODO replace with value transformers. - -@interface CFilteringJSONSerializer : CJSONSerializer { - NSSet *tests; - NSDictionary *convertersByName; -} - -@property (readwrite, nonatomic, retain) NSSet *tests; -@property (readwrite, nonatomic, retain) NSDictionary *convertersByName; - -- (void)addTest:(JSONConversionTest)inTest; -- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m deleted file mode 100644 index 1ee2a3dd68..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CFilteringJSONSerializer.m +++ /dev/null @@ -1,87 +0,0 @@ -// -// CFilteringJSONSerializer.m -// CouchNotes -// -// Created by Jonathan Wight on 06/20/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import "CFilteringJSONSerializer.h" - -@implementation CFilteringJSONSerializer - -@synthesize tests; -@synthesize convertersByName; - -- (void)dealloc - { - [tests release]; - tests = NULL; - // - [convertersByName release]; - convertersByName = NULL; - // - [super dealloc]; - } - -- (NSData *)serializeObject:(id)inObject error:(NSError **)outError - { - NSData *theData = NULL; - for (JSONConversionTest theTest in self.tests) - { - NSString *theName = theTest(inObject); - if (theName != NULL) - { - id theObject = NULL; - JSONConversionConverter theConverter = [self.convertersByName objectForKey:theName]; - if (theConverter) - { - theObject = theConverter(inObject); - } - - if (theObject) - { - if ([theObject isKindOfClass:[NSData class]]) - { - theData = theObject; - break; - } - else - { - NSError *theError = NULL; - theData = [super serializeObject:theObject error:&theError]; - if (theData != NULL) - { - break; - } - } - } - } - } - - if (theData == NULL) - { - theData = [super serializeObject:inObject error:outError]; - } - - return(theData); - } - -- (void)addTest:(JSONConversionTest)inTest - { - inTest = [[inTest copy] autorelease]; - NSSet *theTests = [self.tests setByAddingObject:inTest]; - self.tests = theTests; - } - -- (void)addConverter:(JSONConversionConverter)inConverter forName:(NSString *)inName - { - NSMutableDictionary *theConvertersByName = [[self.convertersByName mutableCopy] autorelease]; - - inConverter = [[inConverter copy] autorelease]; - [theConvertersByName setObject:inConverter forKey:inName]; - self.convertersByName = theConvertersByName; - } - - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h deleted file mode 100644 index 17631af12f..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// CJSONDeserializer_BlocksExtensions.h -// TouchJSON -// -// Created by Jonathan Wight on 10/15/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import "CJSONDeserializer.h" - -@interface CJSONDeserializer (CJSONDeserializer_BlocksExtensions) - -- (void)deserializeAsDictionary:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block; -- (void)deserializeAsArray:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m deleted file mode 100644 index 7ea774c435..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONDeserializer_BlocksExtensions.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// CJSONDeserializer_BlocksExtensions.m -// TouchJSON -// -// Created by Jonathan Wight on 10/15/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import "CJSONDeserializer_BlocksExtensions.h" - -#import "CJSONScanner.h" - -@implementation CJSONDeserializer (CJSONDeserializer_BlocksExtensions) - -- (void)deserializeAsDictionary:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block { - - NSError *noDataError = nil; - if (inData == NULL || [inData length] == 0) { - noDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; - block(nil, noDataError); - } - - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - - NSError *deserializationError = nil; - self.scanner.data = inData; - NSDictionary *theDictionary = NULL; - BOOL successful = [self.scanner scanJSONDictionary:&theDictionary error:&deserializationError]; - - dispatch_async(dispatch_get_main_queue (), ^{ - if (successful) - block(theDictionary, nil); - else - block(nil, deserializationError); - }); - }]; -} - -- (void)deserializeAsArray:(NSData *)inData completionBlock:(void (^)(id result, NSError *error))block { - - NSError *nullInDataError = nil; - if (inData == NULL || [inData length] == 0) { - nullInDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; - block(nil, nullInDataError); - } - - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - - NSError *deserializationError = nil; - self.scanner.data = inData; - NSArray *theArray = NULL; - BOOL successful = [self.scanner scanJSONArray:&theArray error:&deserializationError]; - - dispatch_async(dispatch_get_main_queue(), ^{ - if (successful) - block(theArray, nil); - else - block(nil, deserializationError); - }); - }]; -} - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h deleted file mode 100644 index 83c9bb2bf4..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// CJSONSerialization.h -// TouchJSON -// -// Created by Jonathan Wight on 03/04/11. -// Copyright 2011 toxicsoftware.com. All rights reserved. -// - -#import - -enum { - kCJSONReadingMutableContainers = 0x1, - kCJSONReadingMutableLeaves = 0x2, - kCJSONReadingAllowFragments = 0x04, -}; -typedef NSUInteger EJSONReadingOptions; - -enum { - kCJJSONWritingPrettyPrinted = 0x1 -}; -typedef NSUInteger EJSONWritingOptions; - - -@interface CJSONSerialization : NSObject { - -} - -+ (BOOL)isValidJSONObject:(id)obj; -+ (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error; -+ (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error; -+ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error; -+ (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m deleted file mode 100644 index 5f603f6c3c..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerialization.m +++ /dev/null @@ -1,59 +0,0 @@ -// -// CJSONSerialization.m -// TouchJSON -// -// Created by Jonathan Wight on 03/04/11. -// Copyright 2011 toxicsoftware.com. All rights reserved. -// - -#import "CJSONSerialization.h" - -#import "CJSONDeserializer.h" -#import "CJSONSerializer.h" - -@implementation CJSONSerialization - -+ (BOOL)isValidJSONObject:(id)obj - { - CJSONSerializer *theSerializer = [CJSONSerializer serializer]; - return([theSerializer isValidJSONObject:obj]); - } - -+ (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error - { - #pragma unused (opt) - - CJSONSerializer *theSerializer = [CJSONSerializer serializer]; - NSData *theData = [theSerializer serializeObject:obj error:error]; - return(theData); - } - -+ (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error - { - CJSONDeserializer *theDeserializer = [CJSONDeserializer deserializer]; - theDeserializer.options = (opt & kCJSONReadingMutableContainers ? 0 : kJSONDeserializationOptions_MutableContainers) - | (opt & kCJSONReadingMutableLeaves ? 0 : kJSONDeserializationOptions_MutableLeaves); - id theObject = [theDeserializer deserialize:data error:error]; - return(theObject); - } - -+ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error - { - // TODO -- this is a quick work around. - NSInteger theSize = -1; - NSData *theData = [self dataWithJSONObject:obj options:opt error:error]; - if (theData) - { - theSize = [stream write:[theData bytes] maxLength:[theData length]]; - } - return(theSize); - } - -+ (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error - { - #pragma unused (stream, opt, error) - // TODO -- how much to read? Ugh. - return(NULL); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h deleted file mode 100644 index 4bba1be220..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// CJSONSerializedData.h -// TouchMetricsTest -// -// Created by Jonathan Wight on 10/31/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import - -@protocol CJSONSerializable -@property (readonly, nonatomic, retain) NSData *serializedJSONData; -@end - -#pragma mark - - -@interface CJSONSerializedData : NSObject { - NSData *data; -} - -@property (readonly, nonatomic, retain) NSData *data; - -- (id)initWithData:(NSData *)inData; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m b/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m deleted file mode 100644 index 881899dcb6..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Experimental/CJSONSerializedData.m +++ /dev/null @@ -1,42 +0,0 @@ -// -// CJSONSerializedData.m -// TouchMetricsTest -// -// Created by Jonathan Wight on 10/31/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import "CJSONSerializedData.h" - -@interface CJSONSerializedData () -@end - -#pragma mark - - -@implementation CJSONSerializedData - -@synthesize data; - -- (id)initWithData:(NSData *)inData - { - if ((self = [super init]) != NULL) - { - data = [inData retain]; - } - return(self); - } - -- (void)dealloc - { - [data release]; - data = NULL; - // - [super dealloc]; - } - -- (NSData *)serializedJSONData - { - return(self.data); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h deleted file mode 100644 index cde1dbba97..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// CDataScanner_Extensions.h -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -@interface CDataScanner (CDataScanner_Extensions) - -- (BOOL)scanCStyleComment:(NSString **)outComment; -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment; - -- (NSUInteger)lineOfScanLocation; -- (NSDictionary *)userInfoForScanLocation; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m b/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m deleted file mode 100644 index 90dbbdaffd..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Extensions/CDataScanner_Extensions.m +++ /dev/null @@ -1,135 +0,0 @@ -// -// CDataScanner_Extensions.m -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner_Extensions.h" - -#define LF 0x000a // Line Feed -#define FF 0x000c // Form Feed -#define CR 0x000d // Carriage Return -#define NEL 0x0085 // Next Line -#define LS 0x2028 // Line Separator -#define PS 0x2029 // Paragraph Separator - -@implementation CDataScanner (CDataScanner_Extensions) - -- (BOOL)scanCStyleComment:(NSString **)outComment -{ -if ([self scanString:@"/*" intoString:NULL] == YES) - { - NSString *theComment = NULL; - if ([self scanUpToString:@"*/" intoString:&theComment] == NO) - [NSException raise:NSGenericException format:@"Started to scan a C style comment but it wasn't terminated."]; - - if ([theComment rangeOfString:@"/*"].location != NSNotFound) - [NSException raise:NSGenericException format:@"C style comments should not be nested."]; - - if ([self scanString:@"*/" intoString:NULL] == NO) - [NSException raise:NSGenericException format:@"C style comment did not end correctly."]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } -else - { - return(NO); - } -} - -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment - { - if ([self scanString:@"//" intoString:NULL] == YES) - { - unichar theCharacters[] = { LF, FF, CR, NEL, LS, PS, }; - NSCharacterSet *theLineBreaksCharacterSet = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithCharacters:theCharacters length:sizeof(theCharacters) / sizeof(*theCharacters)]]; - - NSString *theComment = NULL; - [self scanUpToCharactersFromSet:theLineBreaksCharacterSet intoString:&theComment]; - [self scanCharactersFromSet:theLineBreaksCharacterSet intoString:NULL]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } - else - { - return(NO); - } - } - -- (NSUInteger)lineOfScanLocation - { - NSUInteger theLine = 0; - for (const u_int8_t *C = start; C < current; ++C) - { - // TODO: JIW What about MS-DOS line endings you bastard! (Also other unicode line endings) - if (*C == '\n' || *C == '\r') - { - ++theLine; - } - } - return(theLine); - } - -- (NSDictionary *)userInfoForScanLocation - { - NSUInteger theLine = 0; - const u_int8_t *theLineStart = start; - for (const u_int8_t *C = start; C < current; ++C) - { - if (*C == '\n' || *C == '\r') - { - theLineStart = C - 1; - ++theLine; - } - } - - NSUInteger theCharacter = current - theLineStart; - - NSRange theStartRange = NSIntersectionRange((NSRange){ .location = MAX((NSInteger)self.scanLocation - 20, 0), .length = 20 + (NSInteger)self.scanLocation - 20 }, (NSRange){ .location = 0, .length = self.data.length }); - NSRange theEndRange = NSIntersectionRange((NSRange){ .location = self.scanLocation, .length = 20 }, (NSRange){ .location = 0, .length = self.data.length }); - - - NSString *theSnippet = [NSString stringWithFormat:@"%@!HERE>!%@", - [[[NSString alloc] initWithData:[self.data subdataWithRange:theStartRange] encoding:NSUTF8StringEncoding] autorelease], - [[[NSString alloc] initWithData:[self.data subdataWithRange:theEndRange] encoding:NSUTF8StringEncoding] autorelease] - ]; - - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithUnsignedInteger:theLine], @"line", - [NSNumber numberWithUnsignedInteger:theCharacter], @"character", - [NSNumber numberWithUnsignedInteger:self.scanLocation], @"location", - theSnippet, @"snippet", - NULL]; - return(theUserInfo); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h deleted file mode 100644 index 6e611d0fe5..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// NSDictionary_JSONExtensions.h -// TouchCode -// -// Created by Jonathan Wight on 04/17/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface NSDictionary (NSDictionary_JSONExtensions) - -+ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError; -+ (id)dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m b/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m deleted file mode 100644 index c0bb43cdb6..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/Extensions/NSDictionary_JSONExtensions.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// NSDictionary_JSONExtensions.m -// TouchCode -// -// Created by Jonathan Wight on 04/17/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "NSDictionary_JSONExtensions.h" - -#import "CJSONDeserializer.h" - -@implementation NSDictionary (NSDictionary_JSONExtensions) - -+ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError - { - return([[CJSONDeserializer deserializer] deserialize:inData error:outError]); - } - -+ (id)dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError; - { - NSData *theData = [inJSON dataUsingEncoding:NSUTF8StringEncoding]; - return([self dictionaryWithJSONData:theData error:outError]); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h deleted file mode 100644 index 0c3ed027cd..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// CJSONDeserializer.h -// TouchCode -// -// Created by Jonathan Wight on 12/15/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -#import "CJSONScanner.h" - -extern NSString *const kJSONDeserializerErrorDomain /* = @"CJSONDeserializerErrorDomain" */; - -enum { - kJSONDeserializationOptions_MutableContainers = kJSONScannerOptions_MutableContainers, - kJSONDeserializationOptions_MutableLeaves = kJSONScannerOptions_MutableLeaves, -}; -typedef NSUInteger EJSONDeserializationOptions; - -@class CJSONScanner; - -@interface CJSONDeserializer : NSObject { - CJSONScanner *scanner; - EJSONDeserializationOptions options; -} - -@property (readwrite, nonatomic, retain) CJSONScanner *scanner; -/// Object to return instead when a null encountered in the JSON. Defaults to NSNull. Setting to null causes the scanner to skip null values. -@property (readwrite, nonatomic, retain) id nullObject; -/// JSON must be encoded in Unicode (UTF-8, UTF-16 or UTF-32). Use this if you expect to get the JSON in another encoding. -@property (readwrite, nonatomic, assign) NSStringEncoding allowedEncoding; -@property (readwrite, nonatomic, assign) EJSONDeserializationOptions options; - -+ (id)deserializer; - -- (id)deserialize:(NSData *)inData error:(NSError **)outError; - -- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError; -- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError; - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m deleted file mode 100644 index 27a2d037de..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONDeserializer.m +++ /dev/null @@ -1,161 +0,0 @@ -// -// CJSONDeserializer.m -// TouchCode -// -// Created by Jonathan Wight on 12/15/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONDeserializer.h" - -#import "CJSONScanner.h" -#import "CDataScanner.h" - -NSString *const kJSONDeserializerErrorDomain = @"CJSONDeserializerErrorDomain"; - -@interface CJSONDeserializer () -@end - -@implementation CJSONDeserializer - -@synthesize scanner; -@synthesize options; - -+ (id)deserializer - { - return([[[self alloc] init] autorelease]); - } - -- (id)init - { - if ((self = [super init]) != NULL) - { - } - return(self); - } - -- (void)dealloc - { - [scanner release]; - scanner = NULL; - // - [super dealloc]; - } - -#pragma mark - - -- (CJSONScanner *)scanner - { - if (scanner == NULL) - { - scanner = [[CJSONScanner alloc] init]; - } - return(scanner); - } - -- (id)nullObject - { - return(self.scanner.nullObject); - } - -- (void)setNullObject:(id)inNullObject - { - self.scanner.nullObject = inNullObject; - } - -#pragma mark - - -- (NSStringEncoding)allowedEncoding - { - return(self.scanner.allowedEncoding); - } - -- (void)setAllowedEncoding:(NSStringEncoding)inAllowedEncoding - { - self.scanner.allowedEncoding = inAllowedEncoding; - } - -#pragma mark - - -- (id)deserialize:(NSData *)inData error:(NSError **)outError - { - if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; - - return(NULL); - } - if ([self.scanner setData:inData error:outError] == NO) - { - return(NULL); - } - id theObject = NULL; - if ([self.scanner scanJSONObject:&theObject error:outError] == YES) - return(theObject); - else - return(NULL); - } - -- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError - { - if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; - - return(NULL); - } - if ([self.scanner setData:inData error:outError] == NO) - { - return(NULL); - } - NSDictionary *theDictionary = NULL; - if ([self.scanner scanJSONDictionary:&theDictionary error:outError] == YES) - return(theDictionary); - else - return(NULL); - } - -- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError - { - if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL]; - - return(NULL); - } - if ([self.scanner setData:inData error:outError] == NO) - { - return(NULL); - } - NSArray *theArray = NULL; - if ([self.scanner scanJSONArray:&theArray error:outError] == YES) - return(theArray); - else - return(NULL); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h deleted file mode 100644 index d410893f42..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.h +++ /dev/null @@ -1,95 +0,0 @@ -// -// CJSONScanner.h -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -enum { - kJSONScannerOptions_MutableContainers = 0x1, - kJSONScannerOptions_MutableLeaves = 0x2, -}; -typedef NSUInteger EJSONScannerOptions; - -/// CDataScanner subclass that understands JSON syntax natively. You should generally use CJSONDeserializer instead of this class. (TODO - this could have been a category?) -@interface CJSONScanner : CDataScanner { - BOOL strictEscapeCodes; - id nullObject; - NSStringEncoding allowedEncoding; - EJSONScannerOptions options; -} - -@property (readwrite, nonatomic, assign) BOOL strictEscapeCodes; -@property (readwrite, nonatomic, retain) id nullObject; -@property (readwrite, nonatomic, assign) NSStringEncoding allowedEncoding; -@property (readwrite, nonatomic, assign) EJSONScannerOptions options; - -- (BOOL)setData:(NSData *)inData error:(NSError **)outError; - -- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError; -- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError; -- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError; -- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError; -- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError; - -@end - -extern NSString *const kJSONScannerErrorDomain /* = @"kJSONScannerErrorDomain" */; - -typedef enum { - - // Fundamental scanning errors - kJSONScannerErrorCode_NothingToScan = -11, - kJSONScannerErrorCode_CouldNotDecodeData = -12, - kJSONScannerErrorCode_CouldNotSerializeData = -13, - kJSONScannerErrorCode_CouldNotSerializeObject = -14, - kJSONScannerErrorCode_CouldNotScanObject = -15, - - // Dictionary scanning - kJSONScannerErrorCode_DictionaryStartCharacterMissing = -101, - kJSONScannerErrorCode_DictionaryKeyScanFailed = -102, - kJSONScannerErrorCode_DictionaryKeyNotTerminated = -103, - kJSONScannerErrorCode_DictionaryValueScanFailed = -104, - kJSONScannerErrorCode_DictionaryKeyValuePairNoDelimiter = -105, - kJSONScannerErrorCode_DictionaryNotTerminated = -106, - - // Array scanning - kJSONScannerErrorCode_ArrayStartCharacterMissing = -201, - kJSONScannerErrorCode_ArrayValueScanFailed = -202, - kJSONScannerErrorCode_ArrayValueIsNull = -203, - kJSONScannerErrorCode_ArrayNotTerminated = -204, - - // String scanning - kJSONScannerErrorCode_StringNotStartedWithBackslash = -301, - kJSONScannerErrorCode_StringUnicodeNotDecoded = -302, - kJSONScannerErrorCode_StringUnknownEscapeCode = -303, - kJSONScannerErrorCode_StringNotTerminated = -304, - - // Number scanning - kJSONScannerErrorCode_NumberNotScannable = -401 - -} EJSONScannerErrorCode; diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m deleted file mode 100644 index c5ffeb4a11..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONScanner.m +++ /dev/null @@ -1,676 +0,0 @@ -// -// CJSONScanner.m -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONScanner.h" - -#import "CDataScanner_Extensions.h" - -#if !defined(TREAT_COMMENTS_AS_WHITESPACE) -#define TREAT_COMMENTS_AS_WHITESPACE 0 -#endif // !defined(TREAT_COMMENTS_AS_WHITESPACE) - -NSString *const kJSONScannerErrorDomain = @"kJSONScannerErrorDomain"; - -inline static int HexToInt(char inCharacter) - { - int theValues[] = { 0x0 /* 48 '0' */, 0x1 /* 49 '1' */, 0x2 /* 50 '2' */, 0x3 /* 51 '3' */, 0x4 /* 52 '4' */, 0x5 /* 53 '5' */, 0x6 /* 54 '6' */, 0x7 /* 55 '7' */, 0x8 /* 56 '8' */, 0x9 /* 57 '9' */, -1 /* 58 ':' */, -1 /* 59 ';' */, -1 /* 60 '<' */, -1 /* 61 '=' */, -1 /* 62 '>' */, -1 /* 63 '?' */, -1 /* 64 '@' */, 0xa /* 65 'A' */, 0xb /* 66 'B' */, 0xc /* 67 'C' */, 0xd /* 68 'D' */, 0xe /* 69 'E' */, 0xf /* 70 'F' */, -1 /* 71 'G' */, -1 /* 72 'H' */, -1 /* 73 'I' */, -1 /* 74 'J' */, -1 /* 75 'K' */, -1 /* 76 'L' */, -1 /* 77 'M' */, -1 /* 78 'N' */, -1 /* 79 'O' */, -1 /* 80 'P' */, -1 /* 81 'Q' */, -1 /* 82 'R' */, -1 /* 83 'S' */, -1 /* 84 'T' */, -1 /* 85 'U' */, -1 /* 86 'V' */, -1 /* 87 'W' */, -1 /* 88 'X' */, -1 /* 89 'Y' */, -1 /* 90 'Z' */, -1 /* 91 '[' */, -1 /* 92 '\' */, -1 /* 93 ']' */, -1 /* 94 '^' */, -1 /* 95 '_' */, -1 /* 96 '`' */, 0xa /* 97 'a' */, 0xb /* 98 'b' */, 0xc /* 99 'c' */, 0xd /* 100 'd' */, 0xe /* 101 'e' */, 0xf /* 102 'f' */, }; - if (inCharacter >= '0' && inCharacter <= 'f') - return(theValues[inCharacter - '0']); - else - return(-1); - } - -@interface CJSONScanner () -- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue; -@end - -#pragma mark - - -@implementation CJSONScanner - -@synthesize strictEscapeCodes; -@synthesize nullObject; -@synthesize allowedEncoding; -@synthesize options; - -- (id)init - { - if ((self = [super init]) != NULL) - { - strictEscapeCodes = NO; - nullObject = [[NSNull null] retain]; - } - return(self); - } - -- (void)dealloc - { - [nullObject release]; - nullObject = NULL; - // - [super dealloc]; - } - -#pragma mark - - -- (BOOL)setData:(NSData *)inData error:(NSError **)outError; - { - NSData *theData = inData; - if (theData && theData.length >= 4) - { - // This code is lame, but it works. Because the first character of any JSON string will always be a (ascii) control character we can work out the Unicode encoding by the bit pattern. See section 3 of http://www.ietf.org/rfc/rfc4627.txt - const char *theChars = theData.bytes; - NSStringEncoding theEncoding = NSUTF8StringEncoding; - if (theChars[0] != 0 && theChars[1] == 0) - { - if (theChars[2] != 0 && theChars[3] == 0) - theEncoding = NSUTF16LittleEndianStringEncoding; - else if (theChars[2] == 0 && theChars[3] == 0) - theEncoding = NSUTF32LittleEndianStringEncoding; - } - else if (theChars[0] == 0 && theChars[2] == 0 && theChars[3] != 0) - { - if (theChars[1] == 0) - theEncoding = NSUTF32BigEndianStringEncoding; - else if (theChars[1] != 0) - theEncoding = NSUTF16BigEndianStringEncoding; - } - - NSString *theString = [[NSString alloc] initWithData:theData encoding:theEncoding]; - if (theString == NULL && self.allowedEncoding != 0) - { - theString = [[NSString alloc] initWithData:theData encoding:self.allowedEncoding]; - } - theData = [theString dataUsingEncoding:NSUTF8StringEncoding]; - [theString release]; - } - - if (theData) - { - [super setData:theData]; - return(YES); - } - else - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan data. Data wasn't encoded properly?", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_CouldNotDecodeData userInfo:theUserInfo]; - } - return(NO); - } - } - -- (void)setData:(NSData *)inData - { - [self setData:inData error:NULL]; - } - -#pragma mark - - -- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError - { - BOOL theResult = YES; - - [self skipWhitespace]; - - id theObject = NULL; - - const unichar C = [self currentCharacter]; - switch (C) - { - case 't': - if ([self scanUTF8String:"true" intoString:NULL]) - { - theObject = [NSNumber numberWithBool:YES]; - } - break; - case 'f': - if ([self scanUTF8String:"false" intoString:NULL]) - { - theObject = [NSNumber numberWithBool:NO]; - } - break; - case 'n': - if ([self scanUTF8String:"null" intoString:NULL]) - { - theObject = self.nullObject; - } - break; - case '\"': - case '\'': - theResult = [self scanJSONStringConstant:&theObject error:outError]; - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - theResult = [self scanJSONNumberConstant:&theObject error:outError]; - break; - case '{': - theResult = [self scanJSONDictionary:&theObject error:outError]; - break; - case '[': - theResult = [self scanJSONArray:&theObject error:outError]; - break; - default: - theResult = NO; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan object. Character not a valid JSON character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_CouldNotScanObject userInfo:theUserInfo]; - } - break; - } - - if (outObject != NULL) - *outObject = theObject; - - return(theResult); - } - -- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError - { - NSUInteger theScanLocation = [self scanLocation]; - - [self skipWhitespace]; - - if ([self scanCharacter:'{'] == NO) - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Dictionary that does not start with '{' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryStartCharacterMissing userInfo:theUserInfo]; - } - return(NO); - } - - NSMutableDictionary *theDictionary = [[NSMutableDictionary alloc] init]; - - while ([self currentCharacter] != '}') - { - [self skipWhitespace]; - - if ([self currentCharacter] == '}') - break; - - NSString *theKey = NULL; - if ([self scanJSONStringConstant:&theKey error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Failed to scan a key.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyScanFailed userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - [self skipWhitespace]; - - if ([self scanCharacter:':'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Key was not terminated with a ':' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyNotTerminated userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - id theValue = NULL; - if ([self scanJSONObject:&theValue error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Failed to scan a value.", NSLocalizedDescriptionKey, - NULL]; - - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryValueScanFailed userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - if (theValue == NULL && self.nullObject == NULL) - { - // If the value is a null and nullObject is also null then we're skipping this key/value pair. - } - else - { - [theDictionary setValue:theValue forKey:theKey]; - } - - [self skipWhitespace]; - if ([self scanCharacter:','] == NO) - { - if ([self currentCharacter] != '}') - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Key value pairs not delimited with a ',' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryKeyValuePairNoDelimiter userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - break; - } - else - { - [self skipWhitespace]; - if ([self currentCharacter] == '}') - break; - } - } - - if ([self scanCharacter:'}'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Dictionary not terminated by a '}' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_DictionaryNotTerminated userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - if (outDictionary != NULL) - { - if (self.options & kJSONScannerOptions_MutableContainers) - { - *outDictionary = [theDictionary autorelease]; - } - else - { - *outDictionary = [[theDictionary copy] autorelease]; - [theDictionary release]; - } - } - else - { - [theDictionary release]; - } - - return(YES); - } - -- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError - { - NSUInteger theScanLocation = [self scanLocation]; - - [self skipWhitespace]; - - if ([self scanCharacter:'['] == NO) - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not started by a '[' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayStartCharacterMissing userInfo:theUserInfo]; - } - return(NO); - } - - NSMutableArray *theArray = [[NSMutableArray alloc] init]; - - [self skipWhitespace]; - while ([self currentCharacter] != ']') - { - NSString *theValue = NULL; - if ([self scanJSONObject:&theValue error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Could not scan a value.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayValueScanFailed userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - - if (theValue == NULL) - { - if (self.nullObject != NULL) - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Value is NULL.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayValueIsNull userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - } - else - { - [theArray addObject:theValue]; - } - - [self skipWhitespace]; - if ([self scanCharacter:','] == NO) - { - [self skipWhitespace]; - if ([self currentCharacter] != ']') - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayNotTerminated userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - - break; - } - [self skipWhitespace]; - } - - [self skipWhitespace]; - - if ([self scanCharacter:']'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_ArrayNotTerminated userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - - if (outArray != NULL) - { - if (self.options & kJSONScannerOptions_MutableContainers) - { - *outArray = [theArray autorelease]; - } - else - { - *outArray = [[theArray copy] autorelease]; - [theArray release]; - } - } - else - { - [theArray release]; - } - return(YES); - } - -- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError - { - NSUInteger theScanLocation = [self scanLocation]; - - [self skipWhitespace]; - - NSMutableString *theString = [[NSMutableString alloc] init]; - - if ([self scanCharacter:'"'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. String not started by a '\"' character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringNotStartedWithBackslash userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - - while ([self scanCharacter:'"'] == NO) - { - NSString *theStringChunk = NULL; - if ([self scanNotQuoteCharactersIntoString:&theStringChunk]) - { - CFStringAppend((CFMutableStringRef)theString, (CFStringRef)theStringChunk); - } - else if ([self scanCharacter:'\\'] == YES) - { - unichar theCharacter = [self scanCharacter]; - switch (theCharacter) - { - case '"': - case '\\': - case '/': - break; - case 'b': - theCharacter = '\b'; - break; - case 'f': - theCharacter = '\f'; - break; - case 'n': - theCharacter = '\n'; - break; - case 'r': - theCharacter = '\r'; - break; - case 't': - theCharacter = '\t'; - break; - case 'u': - { - theCharacter = 0; - - int theShift; - for (theShift = 12; theShift >= 0; theShift -= 4) - { - const int theDigit = HexToInt([self scanCharacter]); - if (theDigit == -1) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. Unicode character could not be decoded.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringUnicodeNotDecoded userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - theCharacter |= (theDigit << theShift); - } - } - break; - default: - { - if (strictEscapeCodes == YES) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. Unknown escape code.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringUnknownEscapeCode userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - } - break; - } - CFStringAppendCharacters((CFMutableStringRef)theString, &theCharacter, 1); - } - else - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. No terminating double quote character.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_StringNotTerminated userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - } - - if (outStringConstant != NULL) - { - if (self.options & kJSONScannerOptions_MutableLeaves) - { - *outStringConstant = [theString autorelease]; - } - else - { - *outStringConstant = [[theString copy] autorelease]; - [theString release]; - } - } - else - { - [theString release]; - } - - return(YES); - } - -- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError - { - NSNumber *theNumber = NULL; - - [self skipWhitespace]; - - if ([self scanNumber:&theNumber] == YES) - { - if (outNumberConstant != NULL) - *outNumberConstant = theNumber; - return(YES); - } - else - { - if (outError) - { - NSMutableDictionary *theUserInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"Could not scan number constant.", NSLocalizedDescriptionKey, - NULL]; - [theUserInfo addEntriesFromDictionary:self.userInfoForScanLocation]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:kJSONScannerErrorCode_NumberNotScannable userInfo:theUserInfo]; - } - return(NO); - } - } - -#if TREAT_COMMENTS_AS_WHITESPACE -- (void)skipWhitespace - { - [super skipWhitespace]; - [self scanCStyleComment:NULL]; - [self scanCPlusPlusStyleComment:NULL]; - [super skipWhitespace]; - } -#endif // TREAT_COMMENTS_AS_WHITESPACE - -#pragma mark - - -- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue - { - u_int8_t *P; - for (P = current; P < end && *P != '\"' && *P != '\\'; ++P) - ; - - if (P == current) - { - return(NO); - } - - if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - - current = P; - - return(YES); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h deleted file mode 100644 index 748a85c045..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// CJSONSerializer.h -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface CJSONSerializer : NSObject { -} - -+ (id)serializer; - -- (BOOL)isValidJSONObject:(id)inObject; - -/// Take any JSON compatible object (generally NSNull, NSNumber, NSString, NSArray and NSDictionary) and produce an NSData containing the serialized JSON. -- (NSData *)serializeObject:(id)inObject error:(NSError **)outError; - -- (NSData *)serializeNull:(NSNull *)inNull error:(NSError **)outError; -- (NSData *)serializeNumber:(NSNumber *)inNumber error:(NSError **)outError; -- (NSData *)serializeString:(NSString *)inString error:(NSError **)outError; -- (NSData *)serializeArray:(NSArray *)inArray error:(NSError **)outError; -- (NSData *)serializeDictionary:(NSDictionary *)inDictionary error:(NSError **)outError; - -@end - -typedef enum { - CJSONSerializerErrorCouldNotSerializeDataType = -1, - CJSONSerializerErrorCouldNotSerializeObject = -1 -} CJSONSerializerError; diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m b/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m deleted file mode 100644 index 952b3c2cb2..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/CJSONSerializer.m +++ /dev/null @@ -1,342 +0,0 @@ -// -// CJSONSerializer.m -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONSerializer.h" - -#import "JSONRepresentation.h" - -static NSData *kNULL = NULL; -static NSData *kFalse = NULL; -static NSData *kTrue = NULL; - -@implementation CJSONSerializer - -+ (void)initialize - { - NSAutoreleasePool *thePool = [[NSAutoreleasePool alloc] init]; - - if (self == [CJSONSerializer class]) - { - if (kNULL == NULL) - kNULL = [[NSData alloc] initWithBytesNoCopy:(void *)"null" length:4 freeWhenDone:NO]; - if (kFalse == NULL) - kFalse = [[NSData alloc] initWithBytesNoCopy:(void *)"false" length:5 freeWhenDone:NO]; - if (kTrue == NULL) - kTrue = [[NSData alloc] initWithBytesNoCopy:(void *)"true" length:4 freeWhenDone:NO]; - - [thePool release]; - } - } - -+ (id)serializer - { - return([[[self alloc] init] autorelease]); - } - -- (BOOL)isValidJSONObject:(id)inObject - { - if ([inObject isKindOfClass:[NSNull class]]) - { - return(YES); - } - else if ([inObject isKindOfClass:[NSNumber class]]) - { - return(YES); - } - else if ([inObject isKindOfClass:[NSString class]]) - { - return(YES); - } - else if ([inObject isKindOfClass:[NSArray class]]) - { - return(YES); - } - else if ([inObject isKindOfClass:[NSDictionary class]]) - { - return(YES); - } - else if ([inObject isKindOfClass:[NSData class]]) - { - return(YES); - } - else if ([inObject respondsToSelector:@selector(JSONDataRepresentation)]) - { - return(YES); - } - else - { - return(NO); - } - } - -- (NSData *)serializeObject:(id)inObject error:(NSError **)outError - { - NSData *theResult = NULL; - - if ([inObject isKindOfClass:[NSNull class]]) - { - theResult = [self serializeNull:inObject error:outError]; - } - else if ([inObject isKindOfClass:[NSNumber class]]) - { - theResult = [self serializeNumber:inObject error:outError]; - } - else if ([inObject isKindOfClass:[NSString class]]) - { - theResult = [self serializeString:inObject error:outError]; - } - else if ([inObject isKindOfClass:[NSArray class]]) - { - theResult = [self serializeArray:inObject error:outError]; - } - else if ([inObject isKindOfClass:[NSDictionary class]]) - { - theResult = [self serializeDictionary:inObject error:outError]; - } - else if ([inObject isKindOfClass:[NSData class]]) - { - NSString *theString = [[[NSString alloc] initWithData:inObject encoding:NSUTF8StringEncoding] autorelease]; - theResult = [self serializeString:theString error:outError]; - } - else if ([inObject respondsToSelector:@selector(JSONDataRepresentation)]) - { - theResult = [inObject JSONDataRepresentation]; - } - else - { - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [NSString stringWithFormat:@"Cannot serialize data of type '%@'", NSStringFromClass([inObject class])], NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:@"TODO_DOMAIN" code:CJSONSerializerErrorCouldNotSerializeDataType userInfo:theUserInfo]; - } - return(NULL); - } - if (theResult == NULL) - { - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [NSString stringWithFormat:@"Could not serialize object '%@'", inObject], NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:@"TODO_DOMAIN" code:CJSONSerializerErrorCouldNotSerializeObject userInfo:theUserInfo]; - } - return(NULL); - } - return(theResult); - } - -- (NSData *)serializeNull:(NSNull *)inNull error:(NSError **)outError - { - #pragma unused (inNull, outError) - return(kNULL); - } - -- (NSData *)serializeNumber:(NSNumber *)inNumber error:(NSError **)outError - { - #pragma unused (outError) - NSData *theResult = NULL; - switch (CFNumberGetType((CFNumberRef)inNumber)) - { - case kCFNumberCharType: - { - int theValue = [inNumber intValue]; - if (theValue == 0) - theResult = kFalse; - else if (theValue == 1) - theResult = kTrue; - else - theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; - } - break; - case kCFNumberFloat32Type: - case kCFNumberFloat64Type: - case kCFNumberFloatType: - case kCFNumberDoubleType: - case kCFNumberSInt8Type: - case kCFNumberSInt16Type: - case kCFNumberSInt32Type: - case kCFNumberSInt64Type: - case kCFNumberShortType: - case kCFNumberIntType: - case kCFNumberLongType: - case kCFNumberLongLongType: - case kCFNumberCFIndexType: - default: - theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; - break; - } - return(theResult); - } - -- (NSData *)serializeString:(NSString *)inString error:(NSError **)outError - { - #pragma unused (outError) - - const char *theUTF8String = [inString UTF8String]; - - NSMutableData *theData = [NSMutableData dataWithLength:strlen(theUTF8String) * 2 + 2]; - - char *theOutputStart = [theData mutableBytes]; - char *OUT = theOutputStart; - - *OUT++ = '"'; - - for (const char *IN = theUTF8String; IN && *IN != '\0'; ++IN) - { - switch (*IN) - { - case '\\': - { - *OUT++ = '\\'; - *OUT++ = '\\'; - } - break; - case '\"': - { - *OUT++ = '\\'; - *OUT++ = '\"'; - } - break; - case '/': - { - *OUT++ = '\\'; - *OUT++ = '/'; - } - break; - case '\b': - { - *OUT++ = '\\'; - *OUT++ = 'b'; - } - break; - case '\f': - { - *OUT++ = '\\'; - *OUT++ = 'f'; - } - break; - case '\n': - { - *OUT++ = '\\'; - *OUT++ = 'n'; - } - break; - case '\r': - { - *OUT++ = '\\'; - *OUT++ = 'r'; - } - break; - case '\t': - { - *OUT++ = '\\'; - *OUT++ = 't'; - } - break; - default: - { - *OUT++ = *IN; - } - break; - } - } - - *OUT++ = '"'; - - theData.length = OUT - theOutputStart; - return(theData); - } - -- (NSData *)serializeArray:(NSArray *)inArray error:(NSError **)outError - { - NSMutableData *theData = [NSMutableData data]; - - [theData appendBytes:"[" length:1]; - - NSEnumerator *theEnumerator = [inArray objectEnumerator]; - id theValue = NULL; - NSUInteger i = 0; - while ((theValue = [theEnumerator nextObject]) != NULL) - { - NSData *theValueData = [self serializeObject:theValue error:outError]; - if (theValueData == NULL) - { - return(NULL); - } - [theData appendData:theValueData]; - if (++i < [inArray count]) - [theData appendBytes:"," length:1]; - } - - [theData appendBytes:"]" length:1]; - - return(theData); - } - -- (NSData *)serializeDictionary:(NSDictionary *)inDictionary error:(NSError **)outError - { - NSMutableData *theData = [NSMutableData data]; - - [theData appendBytes:"{" length:1]; - - NSArray *theKeys = [inDictionary allKeys]; - NSEnumerator *theEnumerator = [theKeys objectEnumerator]; - NSString *theKey = NULL; - while ((theKey = [theEnumerator nextObject]) != NULL) - { - id theValue = [inDictionary objectForKey:theKey]; - - NSData *theKeyData = [self serializeString:theKey error:outError]; - if (theKeyData == NULL) - { - return(NULL); - } - NSData *theValueData = [self serializeObject:theValue error:outError]; - if (theValueData == NULL) - { - return(NULL); - } - - - [theData appendData:theKeyData]; - [theData appendBytes:":" length:1]; - [theData appendData:theValueData]; - - if (theKey != [theKeys lastObject]) - [theData appendData:[@"," dataUsingEncoding:NSASCIIStringEncoding]]; - } - - [theData appendBytes:"}" length:1]; - - return(theData); - } - -@end diff --git a/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h b/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h deleted file mode 100644 index a83d76fc88..0000000000 --- a/src/extThree20JSON/Vendors/TouchJSON/JSON/JSONRepresentation.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// JSONRepresentation.h -// TouchJSON -// -// Created by Jonathan Wight on 10/15/10. -// Copyright 2010 toxicsoftware.com. All rights reserved. -// - -#import - -@protocol JSONRepresentation - -@optional -- (id)initWithJSONDataRepresentation:(NSData *)inJSONData; - -- (NSData *)JSONDataRepresentation; - -@end From bc1e92b7e226c3d85d1538b5c2b7cb5384e0a588 Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 20 Mar 2011 15:34:32 +0100 Subject: [PATCH 06/16] Added touchJSON submodule --- src/extThree20JSON/Vendors/TouchJSON | 1 + 1 file changed, 1 insertion(+) create mode 160000 src/extThree20JSON/Vendors/TouchJSON diff --git a/src/extThree20JSON/Vendors/TouchJSON b/src/extThree20JSON/Vendors/TouchJSON new file mode 160000 index 0000000000..2abba33a21 --- /dev/null +++ b/src/extThree20JSON/Vendors/TouchJSON @@ -0,0 +1 @@ +Subproject commit 2abba33a21b9aacc16d6fdca14696155190b5ab6 From 502fe8ed17343c39178a3ddca5d56db947e1b772 Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 20 Mar 2011 15:45:53 +0100 Subject: [PATCH 07/16] Changed file source for the TouchJSON code. Added it as submodule in XCODE --- .../extThree20JSON.xcodeproj/project.pbxproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 408348edd9..acebd1389a 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -390,7 +390,7 @@ 6E645A1F11876CA800F08CB1 /* Vendors */ = { isa = PBXGroup; children = ( - C6CCA17F1328466700F27105 /* TouchJSON */, + C6CCA17F1328466700F27105 /* Source */, 6E645A2011876CA800F08CB1 /* SBJSON */, 6E645AF71187744C00F08CB1 /* YAJL */, ); @@ -517,7 +517,7 @@ name = Configurations; sourceTree = ""; }; - C6CCA17F1328466700F27105 /* TouchJSON */ = { + C6CCA17F1328466700F27105 /* Source */ = { isa = PBXGroup; children = ( C6CCA1801328466700F27105 /* CDataScanner.h */, @@ -526,7 +526,8 @@ C6CCA18B1328466700F27105 /* Extensions */, C6CCA1901328466700F27105 /* JSON */, ); - path = TouchJSON; + name = Source; + path = TouchJSON/Source; sourceTree = ""; }; C6CCA1821328466700F27105 /* Experimental */ = { From 370d53064a3f16d5a1ca602d6a4ba3b26ae487ea Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 20 Mar 2011 15:46:11 +0100 Subject: [PATCH 08/16] Added the git submodules to the repository --- .gitmodules | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..9bf3f33672 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "src/extThree20JSON/Vendors/TouchJSON/TouchJSON"] + path = src/extThree20JSON/Vendors/TouchJSON/TouchJSON + url = git://github.com/TouchCode/TouchJSON.git +[submodule "src/extThree20JSON/Vendors/TouchJSON"] + path = src/extThree20JSON/Vendors/TouchJSON + url = git://github.com/TouchCode/TouchJSON.git From 9c6d4b45e5cc5da923f8c4488a855d5fddddc400 Mon Sep 17 00:00:00 2001 From: DominicBoettger Date: Sun, 20 Mar 2011 07:52:51 -0700 Subject: [PATCH 09/16] Edited submodules file --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9bf3f33672..72465daef5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "src/extThree20JSON/Vendors/TouchJSON/TouchJSON"] - path = src/extThree20JSON/Vendors/TouchJSON/TouchJSON - url = git://github.com/TouchCode/TouchJSON.git [submodule "src/extThree20JSON/Vendors/TouchJSON"] path = src/extThree20JSON/Vendors/TouchJSON url = git://github.com/TouchCode/TouchJSON.git From 57dd0f8c1c433340247da27379fc8363d0271eb3 Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 10 Apr 2011 18:14:55 +0200 Subject: [PATCH 10/16] Changes to TouchJSON config and added JSONKit as submodule --- .gitmodules | 3 +++ .../{ => Configurations}/Library+TouchJSON.xcconfig | 0 src/extThree20JSON/Vendors/JSONKit | 1 + 3 files changed, 4 insertions(+) rename src/extThree20JSON/{ => Configurations}/Library+TouchJSON.xcconfig (100%) create mode 160000 src/extThree20JSON/Vendors/JSONKit diff --git a/.gitmodules b/.gitmodules index 72465daef5..cdb19190fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/extThree20JSON/Vendors/TouchJSON"] path = src/extThree20JSON/Vendors/TouchJSON url = git://github.com/TouchCode/TouchJSON.git +[submodule "src/extThree20JSON/Vendors/JSONKit"] + path = src/extThree20JSON/Vendors/JSONKit + url = git://github.com/johnezang/JSONKit.git diff --git a/src/extThree20JSON/Library+TouchJSON.xcconfig b/src/extThree20JSON/Configurations/Library+TouchJSON.xcconfig similarity index 100% rename from src/extThree20JSON/Library+TouchJSON.xcconfig rename to src/extThree20JSON/Configurations/Library+TouchJSON.xcconfig diff --git a/src/extThree20JSON/Vendors/JSONKit b/src/extThree20JSON/Vendors/JSONKit new file mode 160000 index 0000000000..2e6ccf4ecc --- /dev/null +++ b/src/extThree20JSON/Vendors/JSONKit @@ -0,0 +1 @@ +Subproject commit 2e6ccf4ecc28db1e7c511546f269233d96c87f4c From 1332808594fc27829172b733d6071a3e7cccab01 Mon Sep 17 00:00:00 2001 From: dob Date: Sun, 10 Apr 2011 18:15:32 +0200 Subject: [PATCH 11/16] Added JSONKit to extThree20JSON --- .../Configurations/Library+JSONKit.xcconfig | 29 ++ .../Headers/extThree20JSON+JSONKit_Prefix.pch | 21 + src/extThree20JSON/Source/TTExtensionLoader.m | 5 +- src/extThree20JSON/Source/TTURLJSONResponse.m | 12 + .../extThree20JSON.xcodeproj/project.pbxproj | 375 +++++++++++++++++- 5 files changed, 428 insertions(+), 14 deletions(-) create mode 100644 src/extThree20JSON/Configurations/Library+JSONKit.xcconfig create mode 100644 src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch diff --git a/src/extThree20JSON/Configurations/Library+JSONKit.xcconfig b/src/extThree20JSON/Configurations/Library+JSONKit.xcconfig new file mode 100644 index 0000000000..89cb2d3428 --- /dev/null +++ b/src/extThree20JSON/Configurations/Library+JSONKit.xcconfig @@ -0,0 +1,29 @@ +// +// Copyright 2011 Dominic Böttger - Inspirationlabs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "../common/Configurations/Library.xcconfig" +#include "../common/Configurations/Libraries.xcconfig" + +BASE_PRODUCT_NAME = extThree20JSON +PRODUCT_NAME = $(BASE_PRODUCT_NAME)+JSONKit +BUILD_LIBRARY_VERSION = 1.0 + +// We override these paths in order to copy the headers to the same directory, +// regardless of target. +PRIVATE_HEADERS_FOLDER_PATH = /../three20/$(BASE_PRODUCT_NAME)/private +PUBLIC_HEADERS_FOLDER_PATH = /../three20/$(BASE_PRODUCT_NAME) + +GCC_PREFIX_HEADER = $(SRCROOT)/Headers/$(BASE_PRODUCT_NAME)+JSONKit_Prefix.pch diff --git a/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch b/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch new file mode 100644 index 0000000000..4c2a9861a4 --- /dev/null +++ b/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch @@ -0,0 +1,21 @@ +// +// Copyright 2011 Dominic Böttger - Inspirationlabs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "../../common/Xcode324iOS41Fix.pch" + +#ifdef __OBJC__ + #import +#endif diff --git a/src/extThree20JSON/Source/TTExtensionLoader.m b/src/extThree20JSON/Source/TTExtensionLoader.m index 3eb933af74..ce78fbd025 100644 --- a/src/extThree20JSON/Source/TTExtensionLoader.m +++ b/src/extThree20JSON/Source/TTExtensionLoader.m @@ -44,6 +44,7 @@ - (TTExtensionInfo*)extensionInfoNamedThree20JSON { extension.license = @"Apache 2.0"; extension.authors = [NSArray arrayWithObjects: [TTExtensionAuthor authorWithName:@"Jeff Verkoeyen"], + [TTExtensionAuthor authorWithName:@"Dominic Böttger"], nil]; #ifdef EXTJSON_SBJSON @@ -55,8 +56,10 @@ - (TTExtensionInfo*)extensionInfoNamedThree20JSON { #elif defined(EXTJSON_TouchJSON) extension.version = [extension.version stringByAppendingString:@" TouchJSON"]; extension.copyright = [extension.copyright stringByAppendingString:@" 2008 Jonathan Wight"]; +#elif defined(EXTJSON_JSONKit) + extension.version = [extension.version stringByAppendingString:@" JSONKit"]; + extension.copyright = [extension.copyright stringByAppendingString:@" 2011 John Engelhart"]; #endif - return [extension autorelease]; } diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index a9faf87d82..2ebd8bafbd 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -24,6 +24,8 @@ #import "extThree20JSON/NSObject+YAJL.h" #elif defined(EXTJSON_TouchJSON) #import "extThree20JSON/CJSONDeserializer.h" +#elif defined(EXTJSON_JSONKit) +#import "extThree20JSON/JSONKit.h" #endif // Core @@ -83,6 +85,16 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r } #elif defined(EXTJSON_TouchJSON) _rootObject = [[CJSONDeserializer deserializer] deserialize:data error:&err]; +#elif defined(EXTJSON_JSONKit) + + @try { + _rootObject = [[[JSONDecoder decoder] objectWithData:data error:&err] retain]; + } + @catch (NSException* exception) { + err = [NSError errorWithDomain:kTTExtJSONErrorDomain + code:kTTExtJSONErrorCodeInvalidJSON + userInfo:[exception userInfo]]; + } #endif } diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index acebd1389a..74d85448d2 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -66,7 +66,16 @@ 6E6462121187DD2F00F08CB1 /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6E6462131187DD3300F08CB1 /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6EB460DA1183D8CB00685649 /* libextThree20JSON+SBJSON.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */; }; - C6429F2F1327DCE30062B00C /* Library+TouchJSON.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */; }; + C641E5C81351FBB200676C51 /* TTURLJSONResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E645A1A11876C9800F08CB1 /* TTURLJSONResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C641E5CF1351FBB200676C51 /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C641E5D01351FBB200676C51 /* TTErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 664B29E812848B1A0008D569 /* TTErrorCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C641E5D11351FBB200676C51 /* TTExtensionLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 6609982012939800007B1E07 /* TTExtensionLoader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C641E5D41351FBB200676C51 /* TTURLJSONResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E645A1C11876C9800F08CB1 /* TTURLJSONResponse.m */; }; + C641E5DA1351FBB200676C51 /* TTErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 664B29EF12848B270008D569 /* TTErrorCodes.m */; }; + C641E5DB1351FBB200676C51 /* TTExtensionLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 66099817129397F5007B1E07 /* TTExtensionLoader.m */; }; + C641E68C1351FF7900676C51 /* JSONKit.h in Headers */ = {isa = PBXBuildFile; fileRef = C641E6891351FF7900676C51 /* JSONKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C641E68D1351FF7900676C51 /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = C641E68A1351FF7900676C51 /* JSONKit.m */; }; + C641E69C135202A000676C51 /* extThree20JSON+JSONKit_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = C641E69B135202A000676C51 /* extThree20JSON+JSONKit_Prefix.pch */; }; C6429F4C1327E0930062B00C /* TTURLJSONResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E645A1A11876C9800F08CB1 /* TTURLJSONResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; C6429F521327E0930062B00C /* extThree20JSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E6462111187DD2A00F08CB1 /* extThree20JSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; C6429F531327E0930062B00C /* TTErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 664B29E812848B1A0008D569 /* TTErrorCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -164,6 +173,20 @@ remoteGlobalIDString = BEF31F390F352DF5000DE5D2; remoteInfo = extThree20JSON; }; + C641E5C41351FBB200676C51 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A6A11876D3F00F08CB1 /* Three20Core.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BEF31F390F352DF5000DE5D2; + remoteInfo = Three20Core; + }; + C641E5C61351FBB200676C51 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A7311876D4600F08CB1 /* Three20Network.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BEF31F390F352DF5000DE5D2; + remoteInfo = Three20Network; + }; C6429F481327E0930062B00C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6E645A6A11876D3F00F08CB1 /* Three20Core.xcodeproj */; @@ -250,7 +273,36 @@ 6EB460921183D16000685649 /* UnitTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UnitTests-Info.plist"; path = "UnitTests/Resources/PropertyLists/UnitTests-Info.plist"; sourceTree = ""; }; 6EB460A61183D2AC00685649 /* UnitTests+SBJSON.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "UnitTests+SBJSON.xcconfig"; path = "Configurations/UnitTests+SBJSON.xcconfig"; sourceTree = ""; }; BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libextThree20JSON+SBJSON.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Library+TouchJSON.xcconfig"; sourceTree = ""; }; + C641E5E11351FBB200676C51 /* libextThree20JSON+JSONKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libextThree20JSON+JSONKit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C641E6651351FF7900676C51 /* config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = config; sourceTree = ""; }; + C641E6661351FF7900676C51 /* description */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = description; sourceTree = ""; }; + C641E6671351FF7900676C51 /* HEAD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HEAD; sourceTree = ""; }; + C641E6691351FF7900676C51 /* applypatch-msg.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "applypatch-msg.sample"; sourceTree = ""; }; + C641E66A1351FF7900676C51 /* commit-msg.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "commit-msg.sample"; sourceTree = ""; }; + C641E66B1351FF7900676C51 /* post-commit.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "post-commit.sample"; sourceTree = ""; }; + C641E66C1351FF7900676C51 /* post-receive.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "post-receive.sample"; sourceTree = ""; }; + C641E66D1351FF7900676C51 /* post-update.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "post-update.sample"; sourceTree = ""; }; + C641E66E1351FF7900676C51 /* pre-applypatch.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "pre-applypatch.sample"; sourceTree = ""; }; + C641E66F1351FF7900676C51 /* pre-commit.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "pre-commit.sample"; sourceTree = ""; }; + C641E6701351FF7900676C51 /* pre-rebase.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "pre-rebase.sample"; sourceTree = ""; }; + C641E6711351FF7900676C51 /* prepare-commit-msg.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "prepare-commit-msg.sample"; sourceTree = ""; }; + C641E6721351FF7900676C51 /* update.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update.sample; sourceTree = ""; }; + C641E6731351FF7900676C51 /* index */ = {isa = PBXFileReference; lastKnownFileType = file; path = index; sourceTree = ""; }; + C641E6751351FF7900676C51 /* exclude */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = exclude; sourceTree = ""; }; + C641E6771351FF7900676C51 /* HEAD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HEAD; sourceTree = ""; }; + C641E67A1351FF7900676C51 /* master */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = master; sourceTree = ""; }; + C641E67E1351FF7900676C51 /* pack-7790b2b75c82136c793e5b2a39a48eaccb210402.idx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "pack-7790b2b75c82136c793e5b2a39a48eaccb210402.idx"; sourceTree = ""; }; + C641E67F1351FF7900676C51 /* pack-7790b2b75c82136c793e5b2a39a48eaccb210402.pack */ = {isa = PBXFileReference; lastKnownFileType = file; path = "pack-7790b2b75c82136c793e5b2a39a48eaccb210402.pack"; sourceTree = ""; }; + C641E6801351FF7900676C51 /* packed-refs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "packed-refs"; sourceTree = ""; }; + C641E6831351FF7900676C51 /* master */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = master; sourceTree = ""; }; + C641E6861351FF7900676C51 /* HEAD */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HEAD; sourceTree = ""; }; + C641E6881351FF7900676C51 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG.md; sourceTree = ""; }; + C641E6891351FF7900676C51 /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = ""; }; + C641E68A1351FF7900676C51 /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = ""; }; + C641E68B1351FF7900676C51 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; + C641E69B135202A000676C51 /* extThree20JSON+JSONKit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "extThree20JSON+JSONKit_Prefix.pch"; path = "Headers/extThree20JSON+JSONKit_Prefix.pch"; sourceTree = ""; }; + C641E6BD135203A500676C51 /* Library+TouchJSON.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Library+TouchJSON.xcconfig"; path = "Configurations/Library+TouchJSON.xcconfig"; sourceTree = ""; }; + C641E6BE135203BB00676C51 /* Library+JSONKit.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Library+JSONKit.xcconfig"; path = "Configurations/Library+JSONKit.xcconfig"; sourceTree = ""; }; C6429F771327E0930062B00C /* libextThree20JSON+TouchJSON.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libextThree20JSON+TouchJSON.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C6429F9B1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "extThree20JSON+TouchJSON_Prefix.pch"; path = "Headers/extThree20JSON+TouchJSON_Prefix.pch"; sourceTree = ""; }; C6CCA1801328466700F27105 /* CDataScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner.h; sourceTree = ""; }; @@ -292,6 +344,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C641E5DC1351FBB200676C51 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6429F721327E0930062B00C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -319,6 +378,7 @@ 6E645BD91187751200F08CB1 /* libextThree20JSON+YAJL.a */, EB9E6C6210B6A8F800DE563C /* extJSONUnitTests+SBJSON.octest */, C6429F771327E0930062B00C /* libextThree20JSON+TouchJSON.a */, + C641E5E11351FBB200676C51 /* libextThree20JSON+JSONKit.a */, ); name = Products; sourceTree = ""; @@ -330,6 +390,7 @@ 6E645BF71187771D00F08CB1 /* extThree20JSON+SBJSON_Prefix.pch */, 6E645BF81187771D00F08CB1 /* extThree20JSON+YAJL_Prefix.pch */, C6429F9B1327E54E0062B00C /* extThree20JSON+TouchJSON_Prefix.pch */, + C641E69B135202A000676C51 /* extThree20JSON+JSONKit_Prefix.pch */, 6609982012939800007B1E07 /* TTExtensionLoader.h */, 66099817129397F5007B1E07 /* TTExtensionLoader.m */, 6EB4609C1183D1E000685649 /* Source */, @@ -390,9 +451,10 @@ 6E645A1F11876CA800F08CB1 /* Vendors */ = { isa = PBXGroup; children = ( - C6CCA17F1328466700F27105 /* Source */, - 6E645A2011876CA800F08CB1 /* SBJSON */, 6E645AF71187744C00F08CB1 /* YAJL */, + C641E6621351FF7800676C51 /* JSONKit */, + C6CCA17F1328466700F27105 /* TouchJSON */, + 6E645A2011876CA800F08CB1 /* SBJSON */, ); path = Vendors; sourceTree = ""; @@ -508,16 +570,170 @@ 6ED118E41183C38A0096AEBF /* Configurations */ = { isa = PBXGroup; children = ( + C641E6BE135203BB00676C51 /* Library+JSONKit.xcconfig */, 6E55A4B31183CA80002768DE /* Library+SBJSON.xcconfig */, 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */, + C641E6BD135203A500676C51 /* Library+TouchJSON.xcconfig */, 6E6454021184BDD500F08CB1 /* Project.xcconfig */, 6EB460A61183D2AC00685649 /* UnitTests+SBJSON.xcconfig */, - C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */, ); name = Configurations; sourceTree = ""; }; - C6CCA17F1328466700F27105 /* Source */ = { + C641E6621351FF7800676C51 /* JSONKit */ = { + isa = PBXGroup; + children = ( + C641E6631351FF7900676C51 /* .git */, + C641E6881351FF7900676C51 /* CHANGELOG.md */, + C641E6891351FF7900676C51 /* JSONKit.h */, + C641E68A1351FF7900676C51 /* JSONKit.m */, + C641E68B1351FF7900676C51 /* README.md */, + ); + path = JSONKit; + sourceTree = ""; + }; + C641E6631351FF7900676C51 /* .git */ = { + isa = PBXGroup; + children = ( + C641E6641351FF7900676C51 /* branches */, + C641E6651351FF7900676C51 /* config */, + C641E6661351FF7900676C51 /* description */, + C641E6671351FF7900676C51 /* HEAD */, + C641E6681351FF7900676C51 /* hooks */, + C641E6731351FF7900676C51 /* index */, + C641E6741351FF7900676C51 /* info */, + C641E6761351FF7900676C51 /* logs */, + C641E67B1351FF7900676C51 /* objects */, + C641E6801351FF7900676C51 /* packed-refs */, + C641E6811351FF7900676C51 /* refs */, + ); + path = .git; + sourceTree = ""; + }; + C641E6641351FF7900676C51 /* branches */ = { + isa = PBXGroup; + children = ( + ); + path = branches; + sourceTree = ""; + }; + C641E6681351FF7900676C51 /* hooks */ = { + isa = PBXGroup; + children = ( + C641E6691351FF7900676C51 /* applypatch-msg.sample */, + C641E66A1351FF7900676C51 /* commit-msg.sample */, + C641E66B1351FF7900676C51 /* post-commit.sample */, + C641E66C1351FF7900676C51 /* post-receive.sample */, + C641E66D1351FF7900676C51 /* post-update.sample */, + C641E66E1351FF7900676C51 /* pre-applypatch.sample */, + C641E66F1351FF7900676C51 /* pre-commit.sample */, + C641E6701351FF7900676C51 /* pre-rebase.sample */, + C641E6711351FF7900676C51 /* prepare-commit-msg.sample */, + C641E6721351FF7900676C51 /* update.sample */, + ); + path = hooks; + sourceTree = ""; + }; + C641E6741351FF7900676C51 /* info */ = { + isa = PBXGroup; + children = ( + C641E6751351FF7900676C51 /* exclude */, + ); + path = info; + sourceTree = ""; + }; + C641E6761351FF7900676C51 /* logs */ = { + isa = PBXGroup; + children = ( + C641E6771351FF7900676C51 /* HEAD */, + C641E6781351FF7900676C51 /* refs */, + ); + path = logs; + sourceTree = ""; + }; + C641E6781351FF7900676C51 /* refs */ = { + isa = PBXGroup; + children = ( + C641E6791351FF7900676C51 /* heads */, + ); + path = refs; + sourceTree = ""; + }; + C641E6791351FF7900676C51 /* heads */ = { + isa = PBXGroup; + children = ( + C641E67A1351FF7900676C51 /* master */, + ); + path = heads; + sourceTree = ""; + }; + C641E67B1351FF7900676C51 /* objects */ = { + isa = PBXGroup; + children = ( + C641E67C1351FF7900676C51 /* info */, + C641E67D1351FF7900676C51 /* pack */, + ); + path = objects; + sourceTree = ""; + }; + C641E67C1351FF7900676C51 /* info */ = { + isa = PBXGroup; + children = ( + ); + path = info; + sourceTree = ""; + }; + C641E67D1351FF7900676C51 /* pack */ = { + isa = PBXGroup; + children = ( + C641E67E1351FF7900676C51 /* pack-7790b2b75c82136c793e5b2a39a48eaccb210402.idx */, + C641E67F1351FF7900676C51 /* pack-7790b2b75c82136c793e5b2a39a48eaccb210402.pack */, + ); + path = pack; + sourceTree = ""; + }; + C641E6811351FF7900676C51 /* refs */ = { + isa = PBXGroup; + children = ( + C641E6821351FF7900676C51 /* heads */, + C641E6841351FF7900676C51 /* remotes */, + C641E6871351FF7900676C51 /* tags */, + ); + path = refs; + sourceTree = ""; + }; + C641E6821351FF7900676C51 /* heads */ = { + isa = PBXGroup; + children = ( + C641E6831351FF7900676C51 /* master */, + ); + path = heads; + sourceTree = ""; + }; + C641E6841351FF7900676C51 /* remotes */ = { + isa = PBXGroup; + children = ( + C641E6851351FF7900676C51 /* origin */, + ); + path = remotes; + sourceTree = ""; + }; + C641E6851351FF7900676C51 /* origin */ = { + isa = PBXGroup; + children = ( + C641E6861351FF7900676C51 /* HEAD */, + ); + path = origin; + sourceTree = ""; + }; + C641E6871351FF7900676C51 /* tags */ = { + isa = PBXGroup; + children = ( + ); + path = tags; + sourceTree = ""; + }; + C6CCA17F1328466700F27105 /* TouchJSON */ = { isa = PBXGroup; children = ( C6CCA1801328466700F27105 /* CDataScanner.h */, @@ -526,7 +742,7 @@ C6CCA18B1328466700F27105 /* Extensions */, C6CCA1901328466700F27105 /* JSON */, ); - name = Source; + name = TouchJSON; path = TouchJSON/Source; sourceTree = ""; }; @@ -617,6 +833,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C641E5C71351FBB200676C51 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C641E5C81351FBB200676C51 /* TTURLJSONResponse.h in Headers */, + C641E5CF1351FBB200676C51 /* extThree20JSON.h in Headers */, + C641E5D01351FBB200676C51 /* TTErrorCodes.h in Headers */, + C641E5D11351FBB200676C51 /* TTExtensionLoader.h in Headers */, + C641E68C1351FF7900676C51 /* JSONKit.h in Headers */, + C641E69C135202A000676C51 /* extThree20JSON+JSONKit_Prefix.pch in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6429F4B1327E0930062B00C /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -677,6 +906,26 @@ productReference = BEF31F3A0F352DF5000DE5D2 /* libextThree20JSON+SBJSON.a */; productType = "com.apple.product-type.library.static"; }; + C641E5C21351FBB200676C51 /* extThree20JSON+JSONKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = C641E5DD1351FBB200676C51 /* Build configuration list for PBXNativeTarget "extThree20JSON+JSONKit" */; + buildPhases = ( + C641E5C71351FBB200676C51 /* Headers */, + C641E5D21351FBB200676C51 /* Protect Copied Headers */, + C641E5D31351FBB200676C51 /* Sources */, + C641E5DC1351FBB200676C51 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C641E5C31351FBB200676C51 /* PBXTargetDependency */, + C641E5C51351FBB200676C51 /* PBXTargetDependency */, + ); + name = "extThree20JSON+JSONKit"; + productName = Three20; + productReference = C641E5E11351FBB200676C51 /* libextThree20JSON+JSONKit.a */; + productType = "com.apple.product-type.library.static"; + }; C6429F461327E0930062B00C /* extThree20JSON+TouchJSON */ = { isa = PBXNativeTarget; buildConfigurationList = C6429F731327E0930062B00C /* Build configuration list for PBXNativeTarget "extThree20JSON+TouchJSON" */; @@ -754,6 +1003,7 @@ 6E645BA31187751200F08CB1 /* extThree20JSON+YAJL */, EB9E6C6110B6A8F800DE563C /* extThree20JSONUnitTests+SBJSON */, C6429F461327E0930062B00C /* extThree20JSON+TouchJSON */, + C641E5C21351FBB200676C51 /* extThree20JSON+JSONKit */, ); }; /* End PBXProject section */ @@ -794,7 +1044,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C6429F2F1327DCE30062B00C /* Library+TouchJSON.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -829,6 +1078,20 @@ shellPath = "/bin/sh ../scripts/Protect.command"; shellScript = ""; }; + C641E5D21351FBB200676C51 /* Protect Copied Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Protect Copied Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/sh ../scripts/Protect.command"; + shellScript = ""; + }; C6429F601327E0930062B00C /* Protect Copied Headers */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -897,6 +1160,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C641E5D31351FBB200676C51 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C641E5D41351FBB200676C51 /* TTURLJSONResponse.m in Sources */, + C641E5DA1351FBB200676C51 /* TTErrorCodes.m in Sources */, + C641E5DB1351FBB200676C51 /* TTExtensionLoader.m in Sources */, + C641E68D1351FF7900676C51 /* JSONKit.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C6429F611327E0930062B00C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -958,6 +1232,16 @@ target = BEF31F390F352DF5000DE5D2 /* extThree20JSON+SBJSON */; targetProxy = 6EB460DD1183D8D400685649 /* PBXContainerItemProxy */; }; + C641E5C31351FBB200676C51 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Three20Core; + targetProxy = C641E5C41351FBB200676C51 /* PBXContainerItemProxy */; + }; + C641E5C51351FBB200676C51 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Three20Network; + targetProxy = C641E5C61351FBB200676C51 /* PBXContainerItemProxy */; + }; C6429F471327E0930062B00C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Three20Core; @@ -1124,15 +1408,66 @@ }; name = Release; }; + C641E5DE1351FBB200676C51 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C641E6BE135203BB00676C51 /* Library+JSONKit.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + EXTJSON_JSONKit, + DEBUG, + ); + PREBINDING = NO; + PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C641E5DF1351FBB200676C51 /* Internal */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C641E6BE135203BB00676C51 /* Library+JSONKit.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + EXTJSON_SBJSON, + DEBUG, + ); + PREBINDING = NO; + PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; + RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = iphoneos; + }; + name = Internal; + }; + C641E5E01351FBB200676C51 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C641E6BE135203BB00676C51 /* Library+JSONKit.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_SBJSON; + PREBINDING = NO; + PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; + SDKROOT = iphoneos; + ZERO_LINK = NO; + }; + name = Release; + }; C6429F741327E0930062B00C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C6429F2E1327DCE30062B00C /* Library+TouchJSON.xcconfig */; + baseConfigurationReference = C641E6BD135203A500676C51 /* Library+TouchJSON.xcconfig */; buildSettings = { COPY_PHASE_STRIP = NO; EXTTHREE20JSONTOUCHJSON322_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+TouchJSON-Xcode3.2.2.a\""; EXTTHREE20JSONTOUCHJSON325_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+TouchJSON-Xcode3.2.5.a\""; - EXTTHREE20JSONTOUCHJSON_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+SBJSON.a\""; - EXTTHREE20JSONYAJL322_LIB = "-force_load \"$(CONFIGURATION_BUILD_DIR)/libextThree20JSON+YAJL-Xcode3.2.2.a\""; + EXTTHREE20JSONTOUCHJSON_LIB = ""; + EXTTHREE20JSONYAJL322_LIB = ""; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -1146,9 +1481,11 @@ }; C6429F751327E0930062B00C /* Internal */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */; + baseConfigurationReference = C641E6BD135203A500676C51 /* Library+TouchJSON.xcconfig */; buildSettings = { COPY_PHASE_STRIP = NO; + EXTTHREE20JSONTOUCHJSON_LIB = ""; + EXTTHREE20JSONYAJL322_LIB = ""; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; @@ -1164,10 +1501,12 @@ }; C6429F761327E0930062B00C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 663DB06D12661EE900CF8CEA /* Library+YAJL.xcconfig */; + baseConfigurationReference = C641E6BD135203A500676C51 /* Library+TouchJSON.xcconfig */; buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + EXTTHREE20JSONTOUCHJSON_LIB = ""; + EXTTHREE20JSONYAJL322_LIB = ""; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_YAJL; PREBINDING = NO; @@ -1242,6 +1581,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C641E5DD1351FBB200676C51 /* Build configuration list for PBXNativeTarget "extThree20JSON+JSONKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C641E5DE1351FBB200676C51 /* Debug */, + C641E5DF1351FBB200676C51 /* Internal */, + C641E5E01351FBB200676C51 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; C6429F731327E0930062B00C /* Build configuration list for PBXNativeTarget "extThree20JSON+TouchJSON" */ = { isa = XCConfigurationList; buildConfigurations = ( From aba7b3e8252029caae259f9cac0ada8cb306a8f7 Mon Sep 17 00:00:00 2001 From: dob Date: Mon, 16 May 2011 13:16:00 +0200 Subject: [PATCH 12/16] Changed a wrong variable in the configuration for JSONKit and it's Release configuration --- src/Three20UI/Sources/TTNavigatorWindow.m | 2 +- src/extThree20JSON/Source/TTURLJSONResponse.m | 1 - src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Three20UI/Sources/TTNavigatorWindow.m b/src/Three20UI/Sources/TTNavigatorWindow.m index 23c0a1577c..3ce5d06c92 100644 --- a/src/Three20UI/Sources/TTNavigatorWindow.m +++ b/src/Three20UI/Sources/TTNavigatorWindow.m @@ -31,7 +31,7 @@ @implementation TTNavigatorWindow /////////////////////////////////////////////////////////////////////////////////////////////////// - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { - if (event.type == UIEventSubtypeMotionShake + if (motion == UIEventSubtypeMotionShake && [TTNavigator navigator].supportsShakeToReload) { // If you're going to use a custom navigator implementation, you need to ensure that you // implement the reload method. If you're inheriting from TTNavigator, then you're fine. diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index 2ebd8bafbd..88cd3bb3bf 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -86,7 +86,6 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r #elif defined(EXTJSON_TouchJSON) _rootObject = [[CJSONDeserializer deserializer] deserialize:data error:&err]; #elif defined(EXTJSON_JSONKit) - @try { _rootObject = [[[JSONDecoder decoder] objectWithData:data error:&err] retain]; } diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 74d85448d2..f6b31fcba1 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -1451,7 +1451,7 @@ COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_SBJSON; + GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_JSONKit; PREBINDING = NO; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; SDKROOT = iphoneos; From 8ca44fc5aaa52677c9d7d5f44346dd08057a5440 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 22 Jul 2011 01:11:43 +0200 Subject: [PATCH 13/16] Changes for version 1.0.7 --- .../extThree20JSON.xcodeproj/project.pbxproj | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 4286c9ee65..3884b961a7 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -218,6 +218,20 @@ remoteGlobalIDString = BEF31F390F352DF5000DE5D2; remoteInfo = Three20Network; }; + C6AC954F13D8E889003EA563 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A7311876D4600F08CB1 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81EF12630516005851C2; + remoteInfo = "Three20Network-Xcode3.2.5"; + }; + C6AC955113D8E889003EA563 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6E645A7311876D4600F08CB1 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81B2126304EB005851C2; + remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -552,7 +566,9 @@ isa = PBXGroup; children = ( 6E645A7911876D4600F08CB1 /* libThree20Network.a */, + C6AC955013D8E889003EA563 /* libThree20Network-Xcode3.2.5.a */, 6E645A7B11876D4600F08CB1 /* NetworkUnitTests.octest */, + C6AC955213D8E889003EA563 /* NetworkUnitTests-Xcode3.2.5.octest */, ); name = Products; sourceTree = ""; @@ -1097,6 +1113,20 @@ remoteRef = 6E645A7A11876D4600F08CB1 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C6AC955013D8E889003EA563 /* libThree20Network-Xcode3.2.5.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libThree20Network-Xcode3.2.5.a"; + remoteRef = C6AC954F13D8E889003EA563 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C6AC955213D8E889003EA563 /* NetworkUnitTests-Xcode3.2.5.octest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "NetworkUnitTests-Xcode3.2.5.octest"; + remoteRef = C6AC955113D8E889003EA563 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ From 763294a797cb4fff7ceea6dad410a3d70cee3c3e Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 22 Jul 2011 01:28:57 +0200 Subject: [PATCH 14/16] lvm changes --- .../Three20Core.xcodeproj/project.pbxproj | 24 ++++----- .../Three20Network.xcodeproj/project.pbxproj | 40 ++++++-------- .../Three20Style.xcodeproj/project.pbxproj | 54 +++++++++++++------ 3 files changed, 63 insertions(+), 55 deletions(-) diff --git a/src/Three20Core/Three20Core.xcodeproj/project.pbxproj b/src/Three20Core/Three20Core.xcodeproj/project.pbxproj index d74bde33bb..cbec4322c0 100755 --- a/src/Three20Core/Three20Core.xcodeproj/project.pbxproj +++ b/src/Three20Core/Three20Core.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -399,9 +399,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Core" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -531,7 +532,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -546,7 +546,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -558,12 +558,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Internal; @@ -576,7 +575,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -587,8 +586,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -602,7 +600,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -616,7 +613,6 @@ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -627,12 +623,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -643,10 +638,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; diff --git a/src/Three20Network/Three20Network.xcodeproj/project.pbxproj b/src/Three20Network/Three20Network.xcodeproj/project.pbxproj index 39f2f3af07..13f7e3ffdd 100755 --- a/src/Three20Network/Three20Network.xcodeproj/project.pbxproj +++ b/src/Three20Network/Three20Network.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -561,9 +561,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Network" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -779,11 +780,10 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; }; @@ -795,11 +795,10 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; }; @@ -811,9 +810,8 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; ZERO_LINK = NO; @@ -828,7 +826,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; }; @@ -843,7 +841,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -856,8 +854,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; ZERO_LINK = NO; @@ -872,7 +869,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -886,7 +882,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -898,13 +894,12 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Internal; @@ -917,7 +912,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -928,8 +923,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -943,7 +937,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -956,7 +949,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -967,13 +959,12 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -984,11 +975,10 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; diff --git a/src/Three20Style/Three20Style.xcodeproj/project.pbxproj b/src/Three20Style/Three20Style.xcodeproj/project.pbxproj index 97855e1b69..30a4397d5b 100755 --- a/src/Three20Style/Three20Style.xcodeproj/project.pbxproj +++ b/src/Three20Style/Three20Style.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -202,6 +202,20 @@ remoteGlobalIDString = EB9E6C6110B6A8F800DE563C; remoteInfo = UnitTests; }; + C697F63313D8EB0500BAA3A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81EF12630516005851C2; + remoteInfo = "Three20Network-Xcode3.2.5"; + }; + C697F63513D8EB0500BAA3A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81B2126304EB005851C2; + remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -726,7 +740,9 @@ isa = PBXGroup; children = ( 6EE738A31184ADB400A35176 /* libThree20Network.a */, + C697F63413D8EB0500BAA3A4 /* libThree20Network-Xcode3.2.5.a */, 6EE738A51184ADB400A35176 /* NetworkUnitTests.octest */, + C697F63613D8EB0500BAA3A4 /* NetworkUnitTests-Xcode3.2.5.octest */, ); name = Products; sourceTree = ""; @@ -858,9 +874,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20Style" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -918,6 +935,20 @@ remoteRef = 6EE738A41184ADB400A35176 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C697F63413D8EB0500BAA3A4 /* libThree20Network-Xcode3.2.5.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libThree20Network-Xcode3.2.5.a"; + remoteRef = C697F63313D8EB0500BAA3A4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C697F63613D8EB0500BAA3A4 /* NetworkUnitTests-Xcode3.2.5.octest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "NetworkUnitTests-Xcode3.2.5.octest"; + remoteRef = C697F63513D8EB0500BAA3A4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -1090,7 +1121,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -1105,7 +1135,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -1122,13 +1152,12 @@ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", ); GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -1142,7 +1171,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -1153,8 +1182,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -1168,7 +1196,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -1181,7 +1208,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -1197,12 +1223,11 @@ "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", ); GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -1219,11 +1244,10 @@ "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", ); - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_VERSION = com.apple.compilers.llvmgcc42; HEADER_SEARCH_PATHS = .; - PREBINDING = NO; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; From b3e4dee356f1e1988bf1809f16090ec2c27949ba Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 22 Jul 2011 12:35:33 +0200 Subject: [PATCH 15/16] Xcode4 changes --- src/Three20/Three20.xcodeproj/project.pbxproj | 24 ++++----- .../Three20UI.xcodeproj/project.pbxproj | 54 +++++++++++++------ .../Three20UICommon.xcodeproj/project.pbxproj | 24 ++++----- .../project.pbxproj | 24 ++++----- .../project.pbxproj | 28 +++++----- .../Headers/extThree20JSON+JSONKit_Prefix.pch | 2 +- .../extThree20JSON.xcodeproj/project.pbxproj | 45 +++++++--------- 7 files changed, 97 insertions(+), 104 deletions(-) diff --git a/src/Three20/Three20.xcodeproj/project.pbxproj b/src/Three20/Three20.xcodeproj/project.pbxproj index c9badb0f26..6858631179 100755 --- a/src/Three20/Three20.xcodeproj/project.pbxproj +++ b/src/Three20/Three20.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -455,9 +455,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -754,7 +755,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -769,7 +769,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -782,12 +782,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; @@ -802,7 +801,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; }; @@ -814,8 +813,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; ZERO_LINK = NO; @@ -830,7 +828,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -843,7 +840,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -854,12 +850,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; @@ -872,10 +867,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; diff --git a/src/Three20UI/Three20UI.xcodeproj/project.pbxproj b/src/Three20UI/Three20UI.xcodeproj/project.pbxproj index 95037af928..5f676db077 100755 --- a/src/Three20UI/Three20UI.xcodeproj/project.pbxproj +++ b/src/Three20UI/Three20UI.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -431,6 +431,20 @@ remoteGlobalIDString = EB9E6C6110B6A8F800DE563C; remoteInfo = UnitTests; }; + C697F64313D8EB7C00BAA3A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81EF12630516005851C2; + remoteInfo = "Three20Network-Xcode3.2.5"; + }; + C697F64513D8EB7C00BAA3A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 662D81B2126304EB005851C2; + remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -1707,7 +1721,9 @@ isa = PBXGroup; children = ( 6EE738A31184ADB400A35176 /* libThree20Network.a */, + C697F64413D8EB7C00BAA3A4 /* libThree20Network-Xcode3.2.5.a */, 6EE738A51184ADB400A35176 /* NetworkUnitTests.octest */, + C697F64613D8EB7C00BAA3A4 /* NetworkUnitTests-Xcode3.2.5.octest */, ); name = Products; sourceTree = ""; @@ -1924,9 +1940,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UI" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -2038,6 +2055,20 @@ remoteRef = 6EE738A41184ADB400A35176 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C697F64413D8EB7C00BAA3A4 /* libThree20Network-Xcode3.2.5.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libThree20Network-Xcode3.2.5.a"; + remoteRef = C697F64313D8EB7C00BAA3A4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C697F64613D8EB7C00BAA3A4 /* NetworkUnitTests-Xcode3.2.5.octest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "NetworkUnitTests-Xcode3.2.5.octest"; + remoteRef = C697F64513D8EB7C00BAA3A4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -2303,7 +2334,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -2318,7 +2348,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -2330,13 +2360,12 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -2350,7 +2379,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -2361,8 +2390,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -2376,7 +2404,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -2389,7 +2416,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -2400,12 +2426,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -2417,10 +2442,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; diff --git a/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj b/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj index 5e18515ab0..d30b2f6f32 100755 --- a/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj +++ b/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -298,9 +298,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UICommon" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -449,7 +450,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -464,7 +464,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -476,13 +476,12 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -496,7 +495,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -507,8 +506,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -522,7 +520,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -535,7 +532,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -546,12 +542,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -563,10 +558,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; diff --git a/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj b/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj index 27f7645611..7881e5daa5 100755 --- a/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj +++ b/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -508,9 +508,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Three20UINavigator" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -696,7 +697,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -711,7 +711,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -723,13 +723,12 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -743,7 +742,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -754,8 +753,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -769,7 +767,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -782,7 +779,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -793,12 +789,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; }; @@ -810,10 +805,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; diff --git a/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj b/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj index f9c0e99b6f..9e2655e11c 100755 --- a/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj +++ b/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ @@ -558,9 +558,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "extThree20CSSStyle" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -795,6 +796,7 @@ COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = Grammar; }; name = Debug; @@ -802,6 +804,7 @@ 6E083B2E11B6113900B99C32 /* Internal */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = Grammar; }; name = Internal; @@ -811,7 +814,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = Grammar; ZERO_LINK = NO; }; @@ -825,7 +828,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -842,7 +844,7 @@ EXTJSON_SBJSON, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -854,10 +856,9 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Internal; @@ -873,7 +874,7 @@ EXTJSON_SBJSON, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -884,9 +885,8 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_SBJSON; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -900,7 +900,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -914,7 +913,6 @@ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -925,10 +923,9 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -939,8 +936,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; diff --git a/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch b/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch index 4c2a9861a4..d6f5f87ccb 100644 --- a/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch +++ b/src/extThree20JSON/Headers/extThree20JSON+JSONKit_Prefix.pch @@ -14,7 +14,7 @@ // limitations under the License. // -#import "../../common/Xcode324iOS41Fix.pch" +//#import "../../common/Xcode324iOS41Fix.pch" #ifdef __OBJC__ #import diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 3884b961a7..45795eb80b 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -1050,9 +1050,10 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 0410; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "extThree20JSON" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -1364,7 +1365,7 @@ DEBUG, EXTJSON_YAJL, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -1381,7 +1382,7 @@ EXTJSON_YAJL, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -1393,9 +1394,8 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_YAJL; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -1409,7 +1409,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Internal; @@ -1426,7 +1425,7 @@ EXTJSON_SBJSON, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -1438,12 +1437,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Internal; @@ -1459,7 +1457,7 @@ EXTJSON_SBJSON, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -1470,9 +1468,8 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_SBJSON; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -1486,7 +1483,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Debug; @@ -1500,7 +1496,6 @@ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; - PREBINDING = NO; SDKROOT = iphoneos; }; name = Release; @@ -1516,7 +1511,7 @@ EXTJSON_JSONKit, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; SDKROOT = iphoneos; }; @@ -1534,7 +1529,7 @@ EXTJSON_SBJSON, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -1547,9 +1542,8 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_JSONKit; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)+JSONKit"; SDKROOT = iphoneos; ZERO_LINK = NO; @@ -1571,7 +1565,7 @@ DEBUG, EXTJSON_TouchJSON, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -1590,7 +1584,7 @@ EXTJSON_YAJL, DEBUG, ); - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; }; @@ -1604,9 +1598,8 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; EXTTHREE20JSONTOUCHJSON_LIB = ""; EXTTHREE20JSONYAJL322_LIB = ""; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PREPROCESSOR_DEFINITIONS = EXTJSON_YAJL; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; @@ -1618,12 +1611,11 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; }; name = Debug; @@ -1634,10 +1626,9 @@ buildSettings = { COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - PREBINDING = NO; + GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; ZERO_LINK = NO; }; From da64dd467188eb3c1765cbf9620135c741027d96 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 1 Aug 2011 10:07:25 +0200 Subject: [PATCH 16/16] Changes for submitting the App to the AppStore. Changes in three20 to activate skip install --- src/Three20/Three20.xcodeproj/project.pbxproj | 6 ++++++ src/Three20Core/Three20Core.xcodeproj/project.pbxproj | 6 ++++++ .../Three20Network.xcodeproj/project.pbxproj | 9 +++++++++ src/Three20Style/Three20Style.xcodeproj/project.pbxproj | 6 ++++++ src/Three20UI/Three20UI.xcodeproj/project.pbxproj | 6 ++++++ .../Three20UICommon.xcodeproj/project.pbxproj | 6 ++++++ .../Three20UINavigator.xcodeproj/project.pbxproj | 6 ++++++ .../extThree20CSSStyle.xcodeproj/project.pbxproj | 6 ++++++ .../extThree20JSON.xcodeproj/project.pbxproj | 3 +++ 9 files changed, 54 insertions(+) diff --git a/src/Three20/Three20.xcodeproj/project.pbxproj b/src/Three20/Three20.xcodeproj/project.pbxproj index 6858631179..5b2d00f582 100755 --- a/src/Three20/Three20.xcodeproj/project.pbxproj +++ b/src/Three20/Three20.xcodeproj/project.pbxproj @@ -756,6 +756,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -789,6 +790,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Internal; @@ -829,6 +831,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -841,6 +844,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -857,6 +861,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -872,6 +877,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; diff --git a/src/Three20Core/Three20Core.xcodeproj/project.pbxproj b/src/Three20Core/Three20Core.xcodeproj/project.pbxproj index cbec4322c0..a3be47e6f2 100755 --- a/src/Three20Core/Three20Core.xcodeproj/project.pbxproj +++ b/src/Three20Core/Three20Core.xcodeproj/project.pbxproj @@ -533,6 +533,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -564,6 +565,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Internal; }; @@ -601,6 +603,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -614,6 +617,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -629,6 +633,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -642,6 +647,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; ZERO_LINK = NO; }; name = Release; diff --git a/src/Three20Network/Three20Network.xcodeproj/project.pbxproj b/src/Three20Network/Three20Network.xcodeproj/project.pbxproj index 13f7e3ffdd..4b5969d460 100755 --- a/src/Three20Network/Three20Network.xcodeproj/project.pbxproj +++ b/src/Three20Network/Three20Network.xcodeproj/project.pbxproj @@ -786,6 +786,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -801,6 +802,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Internal; }; @@ -814,6 +816,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; PRODUCT_NAME = "$(BASE_PRODUCT_NAME)-Xcode3.2.5"; SDKROOT = iphoneos; + SKIP_INSTALL = NO; ZERO_LINK = NO; }; name = Release; @@ -870,6 +873,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -901,6 +905,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Internal; }; @@ -938,6 +943,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -950,6 +956,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -966,6 +973,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -980,6 +988,7 @@ GCC_PREFIX_HEADER = "$(SRCROOT)/../common/Xcode324iOS41Fix.pch"; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; ZERO_LINK = NO; }; name = Release; diff --git a/src/Three20Style/Three20Style.xcodeproj/project.pbxproj b/src/Three20Style/Three20Style.xcodeproj/project.pbxproj index 30a4397d5b..11efbd7282 100755 --- a/src/Three20Style/Three20Style.xcodeproj/project.pbxproj +++ b/src/Three20Style/Three20Style.xcodeproj/project.pbxproj @@ -1122,6 +1122,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -1159,6 +1160,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Internal; @@ -1197,6 +1199,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -1209,6 +1212,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -1229,6 +1233,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -1249,6 +1254,7 @@ GCC_VERSION = com.apple.compilers.llvmgcc42; HEADER_SEARCH_PATHS = .; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; diff --git a/src/Three20UI/Three20UI.xcodeproj/project.pbxproj b/src/Three20UI/Three20UI.xcodeproj/project.pbxproj index 5f676db077..953cc10513 100755 --- a/src/Three20UI/Three20UI.xcodeproj/project.pbxproj +++ b/src/Three20UI/Three20UI.xcodeproj/project.pbxproj @@ -2335,6 +2335,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -2367,6 +2368,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Internal; @@ -2405,6 +2407,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -2417,6 +2420,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -2432,6 +2436,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -2446,6 +2451,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; diff --git a/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj b/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj index d30b2f6f32..fd1a9e6bcc 100755 --- a/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj +++ b/src/Three20UICommon/Three20UICommon.xcodeproj/project.pbxproj @@ -451,6 +451,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -483,6 +484,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Internal; @@ -521,6 +523,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -533,6 +536,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -548,6 +552,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -562,6 +567,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; diff --git a/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj b/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj index 7881e5daa5..aeaeace1cf 100755 --- a/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj +++ b/src/Three20UINavigator/Three20UINavigator.xcodeproj/project.pbxproj @@ -698,6 +698,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -730,6 +731,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Internal; @@ -768,6 +770,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -780,6 +783,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -795,6 +799,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; }; name = Debug; @@ -809,6 +814,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; WRAPPER_EXTENSION = octest; ZERO_LINK = NO; }; diff --git a/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj b/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj index 9e2655e11c..962332ef8c 100755 --- a/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj +++ b/src/extThree20CSSStyle/extThree20CSSStyle.xcodeproj/project.pbxproj @@ -829,6 +829,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -860,6 +861,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Internal; }; @@ -901,6 +903,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -914,6 +917,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; }; @@ -927,6 +931,7 @@ GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -938,6 +943,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_VERSION = com.apple.compilers.llvmgcc42; SDKROOT = iphoneos; + SKIP_INSTALL = NO; ZERO_LINK = NO; }; name = Release; diff --git a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj index 45795eb80b..bb01b4e4c7 100755 --- a/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj +++ b/src/extThree20JSON/extThree20JSON.xcodeproj/project.pbxproj @@ -1410,6 +1410,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Internal; }; @@ -1484,6 +1485,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Debug; }; @@ -1497,6 +1499,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + SKIP_INSTALL = YES; }; name = Release; };