Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
298 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Classes/lib/Serialization/JSON/NSArray+JSONSerializableSupport.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
// | |||
// NSArray+JSONSerializableSupport.h | |||
// objective_support | |||
// | |||
// Created by James Burka on 2/16/09. | |||
// Copyright 2009 Burkaprojects. All rights reserved. | |||
// | |||
|
|||
#import <UIKit/UIKit.h> | |||
|
|||
|
|||
@interface NSArray(JSONSerializableSupport) | |||
|
|||
- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions | |||
withTranslations:(NSDictionary *)keyTranslations; | |||
|
|||
@end |
35 changes: 35 additions & 0 deletions
35
Classes/lib/Serialization/JSON/NSArray+JSONSerializableSupport.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,35 @@ | |||
// | |||
// NSArray+JSONSerializableSupport.m | |||
// objective_support | |||
// | |||
// Created by James Burka on 2/16/09. | |||
// Copyright 2009 Burkaprojects. All rights reserved. | |||
// | |||
|
|||
#import "JSONFramework.h" | |||
#import "NSObject+JSONSerializableSupport.h" | |||
#import "NSArray+JSONSerializableSupport.h" | |||
|
|||
|
|||
@implementation NSArray(JSONSerializableSupport) | |||
|
|||
- (NSString *)toJSONAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions | |||
withTranslations:(NSDictionary *)keyTranslations { | |||
|
|||
NSMutableString *values = [NSMutableString stringWithString:@"["]; | |||
BOOL comma = NO; | |||
for (id element in self) { | |||
if(comma) { | |||
[values appendString:@","]; | |||
} | |||
else { | |||
comma = YES; | |||
} | |||
[values appendString:[element toJSONAs:[element jsonClassName] excludingInArray:exclusions withTranslations:keyTranslations]]; | |||
|
|||
} | |||
[values appendString:@"]"]; | |||
return values; | |||
} | |||
|
|||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Classes/lib/Serialization/XML/NSNumber+XMLSerializableSupport.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
// | |||
// NSNumber+XMLSerializableSupport.h | |||
// objective_support | |||
// | |||
// Created by James Burka on 2/17/09. | |||
// Copyright 2009 Burkaprojects. All rights reserved. | |||
// | |||
|
|||
@interface NSNumber(XMLSerializableSupport) | |||
- (NSString *)toXMLValue; | |||
|
|||
@end |
25 changes: 25 additions & 0 deletions
25
Classes/lib/Serialization/XML/NSNumber+XMLSerializableSupport.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
// | |||
// NSNumber+XMLSerializableSupport.m | |||
// objective_support | |||
// | |||
// Created by James Burka on 2/17/09. | |||
// Copyright 2009 Burkaprojects. All rights reserved. | |||
// | |||
|
|||
#import "NSObject+XMLSerializableSupport.h" | |||
#import "NSNumber+XMLSerializableSupport.h" | |||
|
|||
|
|||
@implementation NSNumber(XMLSerializableSupport) | |||
|
|||
- (NSString *)toXMLValue { | |||
return [self stringValue]; | |||
} | |||
|
|||
- (NSString *)toXMLElementAs:(NSString *)rootName excludingInArray:(NSArray *)exclusions | |||
withTranslations:(NSDictionary *)keyTranslations { | |||
return [[self class] buildXmlElementAs:rootName withInnerXml:[self toXMLValue] andType:[[self class] xmlTypeFor:self]]; | |||
} | |||
|
|||
|
|||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.