Skip to content

Commit

Permalink
First draft of BMOEDNArchiver, NSCoder implementation. More or le…
Browse files Browse the repository at this point in the history
…ss a translation (and replacement?) of `BMOEDNWriter`. (#11)
  • Loading branch information
benmosher committed Jul 12, 2014
1 parent b813ba6 commit 22f51e9
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 51 deletions.
26 changes: 9 additions & 17 deletions edn-objc.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
B53AE3D817D17E3B000CBCC0 /* BMOEDNRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = B53AE3D517D17648000CBCC0 /* BMOEDNRegistry.m */; };
B53AE3DC17D18024000CBCC0 /* NSDate+BMOEDN.h in Headers */ = {isa = PBXBuildFile; fileRef = B53AE3DA17D18024000CBCC0 /* NSDate+BMOEDN.h */; };
B53AE3DD17D18024000CBCC0 /* NSDate+BMOEDN.m in Sources */ = {isa = PBXBuildFile; fileRef = B53AE3DB17D18024000CBCC0 /* NSDate+BMOEDN.m */; };
B5A7BA7617DC1DF300EE55A1 /* BMOEDNCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A7BA7417DC1DF300EE55A1 /* BMOEDNCoder.h */; };
B5A7BA7717DC1DF300EE55A1 /* BMOEDNCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = B5A7BA7517DC1DF300EE55A1 /* BMOEDNCoder.m */; };
B59D8EA31970DBC300881D63 /* BMOEDNArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = B59D8EA11970DBC300881D63 /* BMOEDNArchiver.h */; };
B59D8EA41970DBC300881D63 /* BMOEDNArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = B59D8EA21970DBC300881D63 /* BMOEDNArchiver.m */; };
B5A7BA7A17DC280B00EE55A1 /* BMOEDNCharacter.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A7BA7817DC280B00EE55A1 /* BMOEDNCharacter.h */; };
B5A7BA7B17DC280B00EE55A1 /* BMOEDNCharacter.m in Sources */ = {isa = PBXBuildFile; fileRef = B5A7BA7917DC280B00EE55A1 /* BMOEDNCharacter.m */; };
B5B837D717D038B900AEA457 /* BMOEDNRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = B5B837D617D038B900AEA457 /* BMOEDNRepresentation.h */; };
Expand Down Expand Up @@ -96,8 +96,8 @@
B53AE3D517D17648000CBCC0 /* BMOEDNRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BMOEDNRegistry.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
B53AE3DA17D18024000CBCC0 /* NSDate+BMOEDN.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+BMOEDN.h"; sourceTree = "<group>"; };
B53AE3DB17D18024000CBCC0 /* NSDate+BMOEDN.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+BMOEDN.m"; sourceTree = "<group>"; };
B5A7BA7417DC1DF300EE55A1 /* BMOEDNCoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMOEDNCoder.h; sourceTree = "<group>"; };
B5A7BA7517DC1DF300EE55A1 /* BMOEDNCoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BMOEDNCoder.m; sourceTree = "<group>"; };
B59D8EA11970DBC300881D63 /* BMOEDNArchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMOEDNArchiver.h; sourceTree = "<group>"; };
B59D8EA21970DBC300881D63 /* BMOEDNArchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BMOEDNArchiver.m; sourceTree = "<group>"; };
B5A7BA7817DC280B00EE55A1 /* BMOEDNCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BMOEDNCharacter.h; sourceTree = "<group>"; };
B5A7BA7917DC280B00EE55A1 /* BMOEDNCharacter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BMOEDNCharacter.m; sourceTree = "<group>"; };
B5B837D617D038B900AEA457 /* BMOEDNRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BMOEDNRepresentation.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
Expand All @@ -108,7 +108,7 @@
B5C7A62617C8F282005E0615 /* libedn-objc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libedn-objc.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B5C7A62917C8F282005E0615 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
B5C7A62D17C8F282005E0615 /* edn-objc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "edn-objc-Prefix.pch"; sourceTree = "<group>"; };
B5C7A62E17C8F282005E0615 /* BMOEDNSerialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BMOEDNSerialization.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
B5C7A62E17C8F282005E0615 /* BMOEDNSerialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BMOEDNSerialization.h; sourceTree = "<group>"; };
B5C7A63017C8F282005E0615 /* BMOEDNSerialization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BMOEDNSerialization.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
B5C7A63717C8F282005E0615 /* edn-objc-tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "edn-objc-tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
B5C7A63817C8F282005E0615 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
Expand Down Expand Up @@ -196,15 +196,6 @@
name = Primitives;
sourceTree = "<group>";
};
B5A7BA7317DC1DDA00EE55A1 /* NSCoding */ = {
isa = PBXGroup;
children = (
B5A7BA7417DC1DF300EE55A1 /* BMOEDNCoder.h */,
B5A7BA7517DC1DF300EE55A1 /* BMOEDNCoder.m */,
);
name = NSCoding;
sourceTree = "<group>";
};
B5B837D517D0389B00AEA457 /* Representation */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -299,7 +290,6 @@
CFA008CB17D44C2F0077B8E2 /* Serialization */ = {
isa = PBXGroup;
children = (
B5A7BA7317DC1DDA00EE55A1 /* NSCoding */,
CFA008DC17D464CF0077B8E2 /* Reading */,
CFA008DD17D464DC0077B8E2 /* Writing */,
);
Expand All @@ -326,6 +316,8 @@
CFA008D917D464AC0077B8E2 /* BMOEDNWriterState.m */,
B5C7A67117CEF1AE005E0615 /* BMOEDNWriter.h */,
B5C7A67217CEF1AE005E0615 /* BMOEDNWriter.m */,
B59D8EA11970DBC300881D63 /* BMOEDNArchiver.h */,
B59D8EA21970DBC300881D63 /* BMOEDNArchiver.m */,
);
name = Writing;
sourceTree = "<group>";
Expand All @@ -342,6 +334,7 @@
B5C7A66C17CDC21A005E0615 /* BMOEDNKeyword.h in Headers */,
B5C7A66D17CDC21A005E0615 /* BMOEDNSerialization.h in Headers */,
B5C7A66E17CDC21A005E0615 /* BMOEDNList.h in Headers */,
B59D8EA31970DBC300881D63 /* BMOEDNArchiver.h in Headers */,
B5C7A66F17CDC21A005E0615 /* NSString+BMOEDN.h in Headers */,
B5C7A67317CEF1AE005E0615 /* BMOEDNWriter.h in Headers */,
B5C7A67817CEFB26005E0615 /* NSObject+BMOEDN.h in Headers */,
Expand All @@ -357,7 +350,6 @@
B5BCDA3C196EAD6A0007B42A /* BMOEDNRatio.h in Headers */,
CFA008DA17D464AC0077B8E2 /* BMOEDNWriterState.h in Headers */,
CFA008E017D4D43C0077B8E2 /* BMOLazyEnumerator.h in Headers */,
B5A7BA7617DC1DF300EE55A1 /* BMOEDNCoder.h in Headers */,
B5A7BA7A17DC280B00EE55A1 /* BMOEDNCharacter.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -460,6 +452,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B59D8EA41970DBC300881D63 /* BMOEDNArchiver.m in Sources */,
B5C7A63117C8F282005E0615 /* BMOEDNSerialization.m in Sources */,
B5C7A65317C9B35D005E0615 /* BMOEDNKeyword.m in Sources */,
B5C7A65917C9C1F4005E0615 /* BMOEDNList.m in Sources */,
Expand All @@ -480,7 +473,6 @@
CFA008DB17D464AC0077B8E2 /* BMOEDNWriterState.m in Sources */,
B5BCDA3D196EAD6A0007B42A /* BMOEDNRatio.m in Sources */,
CFA008E117D4D43C0077B8E2 /* BMOLazyEnumerator.m in Sources */,
B5A7BA7717DC1DF300EE55A1 /* BMOEDNCoder.m in Sources */,
B5A7BA7B17DC280B00EE55A1 /* BMOEDNCharacter.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
17 changes: 17 additions & 0 deletions edn-objc/BMOEDNArchiver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// BMOEDNArchiver.h
// edn-objc
//
// Created by Ben Mosher on 7/11/14.
// Copyright (c) 2014 Ben Mosher. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BMOEDNArchiver : NSCoder

-(instancetype) initForWritingWithMutableData:(NSMutableData *)data;

+(NSData *)archivedDataWithRootObject:(id)object;

@end
Loading

0 comments on commit 22f51e9

Please sign in to comment.