adium-1.4 3382:f46d14768090: First pass at Facebook XMPP. Defini...
commits at adium.im
commits at adium.im
Mon Mar 7 01:12:00 UTC 2011
details: http://hg.adium.im/adium-1.4/rev/f46d14768090
revision: 3382:f46d14768090
author: Colin Barrett <colin at springsandstruts.com>
date: Sun Mar 06 17:09:40 2011 -0800
First pass at Facebook XMPP. Definitely **NOT** ready for actual use, but it does connect.
diffs (truncated from 10137 to 1000 lines):
diff -r 378c29944977 -r f46d14768090 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj Sat Mar 05 03:40:16 2011 +0200
+++ b/Adium.xcodeproj/project.pbxproj Sun Mar 06 17:09:40 2011 -0800
@@ -1146,6 +1146,12 @@
4F1CB6420D640DA40073A1E6 /* info_segment.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F1CB63E0D640DA40073A1E6 /* info_segment.png */; };
4F1CB64C0D640F4F0073A1E6 /* ContactInfoInspector.nib in Resources */ = {isa = PBXBuildFile; fileRef = 4F1CB64B0D640F4F0073A1E6 /* ContactInfoInspector.nib */; };
5A1781860EC1215D00BA1E04 /* AIAutoScrollTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A1781850EC1215D00BA1E04 /* AIAutoScrollTextView.m */; };
+ 5A37D9091308A0B2000CE634 /* f_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 5A5B62A0130712520039B155 /* f_logo.png */; };
+ 5A37D90A1308A0B7000CE634 /* f_logo_small.png in Resources */ = {isa = PBXBuildFile; fileRef = 5A5B62A2130714120039B155 /* f_logo_small.png */; };
+ 5ABEADCD1308889F00DA4C56 /* AIFacebookXMPPService.m in Sources */ = {isa = PBXBuildFile; fileRef = EFA39C091296658B00B36EBB /* AIFacebookXMPPService.m */; };
+ 5ABEADCE130888A800DA4C56 /* AIFacebookXMPPOAuthWebViewWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = EFA39C3012966B2600B36EBB /* AIFacebookXMPPOAuthWebViewWindowController.m */; };
+ 5ACDB4DB1308729D0058322A /* AIFacebookXMPPAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = EFA39C041296658B00B36EBB /* AIFacebookXMPPAccount.m */; };
+ 5ACDB4DD130872AB0058322A /* AIFacebookXMPPAccountViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EFA39C071296658B00B36EBB /* AIFacebookXMPPAccountViewController.m */; };
63093C2F0892143500F118D3 /* newContentThreeDigits.png in Resources */ = {isa = PBXBuildFile; fileRef = 63093C2D0892143500F118D3 /* newContentThreeDigits.png */; };
63093C300892143500F118D3 /* newContentTwoDigits.png in Resources */ = {isa = PBXBuildFile; fileRef = 63093C2E0892143500F118D3 /* newContentTwoDigits.png */; };
6311F4710E340DD2004234B8 /* AISharedAdium.h in Headers */ = {isa = PBXBuildFile; fileRef = 6311F46F0E340DD2004234B8 /* AISharedAdium.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1503,6 +1509,10 @@
EE147A800896B33400A21377 /* OWABSearchWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = EE147A7E0896B33400A21377 /* OWABSearchWindowController.m */; };
EE5754ED0B3D7A7A00100989 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 638392F609D4D67A0067B9B7 /* Sparkle.framework */; };
EEC461B6096D68580028632F /* OWSpellingPerContactPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC461B4096D68580028632F /* OWSpellingPerContactPlugin.m */; };
+ EF3472611324653700CE4177 /* JSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF3464B61324593800CE4177 /* JSON.framework */; };
+ EF34726B1324654800CE4177 /* JSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = EF3464B61324593800CE4177 /* JSON.framework */; };
+ EFA39C0B1296658B00B36EBB /* AIFacebookXMPPAccountView.xib in Resources */ = {isa = PBXBuildFile; fileRef = EFA39C051296658B00B36EBB /* AIFacebookXMPPAccountView.xib */; };
+ EFA39CF612966F5D00B36EBB /* AIFacebookXMPPOauthWebViewWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = EFA39CF512966F5D00B36EBB /* AIFacebookXMPPOauthWebViewWindow.xib */; };
EFB1C3140DDBDA3100B3973D /* AITwitterIMPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = EFB1C3130DDBDA3100B3973D /* AITwitterIMPlugin.m */; };
F51BCD3B0A156261000FDC06 /* AutoHyperlinks.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 3496A8EA07CE6CA30055BBAB /* AutoHyperlinks.framework */; };
F51BCEEA0A15793E000FDC06 /* AutoHyperlinks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3496A8EA07CE6CA30055BBAB /* AutoHyperlinks.framework */; };
@@ -1686,6 +1696,41 @@
remoteGlobalIDString = 7EA3B0440DD1153F002A18D1;
remoteInfo = Test;
};
+ EF3464B51324593800CE4177 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 53D229810C96121600276605;
+ remoteInfo = JSON;
+ };
+ EF3464B71324593800CE4177 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 53D2298D0C96122A00276605;
+ remoteInfo = Tests;
+ };
+ EF3464B91324593800CE4177 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FE2BBD800D8B0D3900184787;
+ remoteInfo = libjson;
+ };
+ EF3464BB1324593800CE4177 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = FE2BBDAB0D8B0EE000184787;
+ remoteInfo = libjsontests;
+ };
+ EF34659613245CCB00CE4177 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 53D229800C96121600276605 /* JSON */;
+ remoteInfo = JSON;
+ };
EFB1C3D70DDCA0A900B3973D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3496A8E707CE6CA30055BBAB /* AutoHyperlinks.framework.xcodeproj */;
@@ -1710,6 +1755,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ EF34726B1324654800CE4177 /* JSON.framework in Copy Frameworks */,
116E33AF10B7263C002EDB0F /* Growl.framework in Copy Frameworks */,
118A44540FEEA82E008153C0 /* libjson-glib.framework in Copy Frameworks */,
633404710F9C18EF003C77A9 /* AIUtilities.framework in Copy Frameworks */,
@@ -4199,6 +4245,8 @@
4F1CB64B0D640F4F0073A1E6 /* ContactInfoInspector.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ContactInfoInspector.nib; path = Resources/ContactInfoInspector.nib; sourceTree = "<group>"; };
5A1781840EC1215D00BA1E04 /* AIAutoScrollTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIAutoScrollTextView.h; path = Source/AIAutoScrollTextView.h; sourceTree = "<group>"; };
5A1781850EC1215D00BA1E04 /* AIAutoScrollTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIAutoScrollTextView.m; path = Source/AIAutoScrollTextView.m; sourceTree = "<group>"; };
+ 5A5B62A0130712520039B155 /* f_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = f_logo.png; path = "Plugins/Purple Service/f_logo.png"; sourceTree = "<group>"; };
+ 5A5B62A2130714120039B155 /* f_logo_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = f_logo_small.png; path = "Plugins/Purple Service/f_logo_small.png"; sourceTree = "<group>"; };
5A764A2211E04DDA00E5E0AF /* sk_SK */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sk_SK; path = Resources/sk_SK.lproj/AccountProxy.nib; sourceTree = "<group>"; };
5A764A2311E04DDB00E5E0AF /* sk_SK */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sk_SK; path = Resources/sk_SK.lproj/AIAdvancedInspectorPane.nib; sourceTree = "<group>"; };
5A764A2411E04DDB00E5E0AF /* sk_SK */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sk_SK; path = Resources/sk_SK.lproj/AppearancePrefs.nib; sourceTree = "<group>"; };
@@ -4803,6 +4851,17 @@
EE147A7F0896B33400A21377 /* OWABSearchWindowController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = OWABSearchWindowController.h; path = Source/OWABSearchWindowController.h; sourceTree = "<group>"; };
EEC461B4096D68580028632F /* OWSpellingPerContactPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = OWSpellingPerContactPlugin.m; path = Source/OWSpellingPerContactPlugin.m; sourceTree = "<group>"; };
EEC461B5096D68580028632F /* OWSpellingPerContactPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = OWSpellingPerContactPlugin.h; path = Source/OWSpellingPerContactPlugin.h; sourceTree = "<group>"; };
+ EF3464AD1324593800CE4177 /* JSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JSON.xcodeproj; path = "Frameworks/json-framework/JSON.xcodeproj"; sourceTree = "<group>"; };
+ EFA39C031296658B00B36EBB /* AIFacebookXMPPAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPAccount.h; path = "Plugins/Purple Service/AIFacebookXMPPAccount.h"; sourceTree = "<group>"; };
+ EFA39C041296658B00B36EBB /* AIFacebookXMPPAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFacebookXMPPAccount.m; path = "Plugins/Purple Service/AIFacebookXMPPAccount.m"; sourceTree = "<group>"; };
+ EFA39C051296658B00B36EBB /* AIFacebookXMPPAccountView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AIFacebookXMPPAccountView.xib; path = "Plugins/Purple Service/AIFacebookXMPPAccountView.xib"; sourceTree = "<group>"; };
+ EFA39C061296658B00B36EBB /* AIFacebookXMPPAccountViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPAccountViewController.h; path = "Plugins/Purple Service/AIFacebookXMPPAccountViewController.h"; sourceTree = "<group>"; };
+ EFA39C071296658B00B36EBB /* AIFacebookXMPPAccountViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFacebookXMPPAccountViewController.m; path = "Plugins/Purple Service/AIFacebookXMPPAccountViewController.m"; sourceTree = "<group>"; };
+ EFA39C081296658B00B36EBB /* AIFacebookXMPPService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPService.h; path = "Plugins/Purple Service/AIFacebookXMPPService.h"; sourceTree = "<group>"; };
+ EFA39C091296658B00B36EBB /* AIFacebookXMPPService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFacebookXMPPService.m; path = "Plugins/Purple Service/AIFacebookXMPPService.m"; sourceTree = "<group>"; };
+ EFA39C2F12966B2600B36EBB /* AIFacebookXMPPOAuthWebViewWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPOAuthWebViewWindowController.h; path = "Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h"; sourceTree = "<group>"; };
+ EFA39C3012966B2600B36EBB /* AIFacebookXMPPOAuthWebViewWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFacebookXMPPOAuthWebViewWindowController.m; path = "Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m"; sourceTree = "<group>"; };
+ EFA39CF512966F5D00B36EBB /* AIFacebookXMPPOauthWebViewWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AIFacebookXMPPOauthWebViewWindow.xib; path = "Plugins/Purple Service/AIFacebookXMPPOauthWebViewWindow.xib"; sourceTree = "<group>"; };
EFB1C3120DDBDA3100B3973D /* AITwitterIMPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AITwitterIMPlugin.h; path = Source/AITwitterIMPlugin.h; sourceTree = "<group>"; };
EFB1C3130DDBDA3100B3973D /* AITwitterIMPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AITwitterIMPlugin.m; path = Source/AITwitterIMPlugin.m; sourceTree = "<group>"; };
F11B9621051CDB3B0000000E /* AIMessageAliasPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIMessageAliasPlugin.h; path = "Plugins/Message Alias Support/AIMessageAliasPlugin.h"; sourceTree = "<group>"; };
@@ -4918,6 +4977,7 @@
639DF9140F97E639003C9A32 /* AdiumLibpurple.framework in Frameworks */,
3448758E06D1EBDF00DA778C /* Cocoa.framework in Frameworks */,
3419F7760531512200C68BA3 /* Adium.framework in Frameworks */,
+ EF3472611324653700CE4177 /* JSON.framework in Frameworks */,
639DF9150F97E639003C9A32 /* libglib.framework in Frameworks */,
639DF9160F97E639003C9A32 /* libgmodule.framework in Frameworks */,
639DF9170F97E639003C9A32 /* libgobject.framework in Frameworks */,
@@ -5256,6 +5316,7 @@
34D1AB510D693DEB00470520 /* RBSplitView.xcodeproj */,
3496A8E707CE6CA30055BBAB /* AutoHyperlinks.framework.xcodeproj */,
346636860D41541A006C9034 /* FriBidi.xcodeproj */,
+ EF3464AD1324593800CE4177 /* JSON.xcodeproj */,
341BDBBA0968BC9A00CF83F5 /* OTR.framework */,
348E5ACA06D2A74C004C051C /* AddressBook.framework */,
F5819CE9032124CE01A8010A /* AppKit.framework */,
@@ -7331,6 +7392,7 @@
4BD672C406001B530049CAF7 /* Services */ = {
isa = PBXGroup;
children = (
+ EFA39B5C1294F9FB00B36EBB /* FB XMPP */,
11F738F40F58D15500B3285B /* Twitter */,
4947F5BB0655E7C400B791E5 /* Bonjour */,
4B7F278605440C6200CDFC90 /* Libpurple */,
@@ -8692,6 +8754,36 @@
name = "Spelling Per Contact";
sourceTree = "<group>";
};
+ EF3464AE1324593800CE4177 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ EF3464B61324593800CE4177 /* JSON.framework */,
+ EF3464B81324593800CE4177 /* Tests.octest */,
+ EF3464BA1324593800CE4177 /* libjson.a */,
+ EF3464BC1324593800CE4177 /* libjsontests.octest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ EFA39B5C1294F9FB00B36EBB /* FB XMPP */ = {
+ isa = PBXGroup;
+ children = (
+ 5A5B62A2130714120039B155 /* f_logo_small.png */,
+ 5A5B62A0130712520039B155 /* f_logo.png */,
+ EFA39C031296658B00B36EBB /* AIFacebookXMPPAccount.h */,
+ EFA39C041296658B00B36EBB /* AIFacebookXMPPAccount.m */,
+ EFA39C051296658B00B36EBB /* AIFacebookXMPPAccountView.xib */,
+ EFA39C061296658B00B36EBB /* AIFacebookXMPPAccountViewController.h */,
+ EFA39C071296658B00B36EBB /* AIFacebookXMPPAccountViewController.m */,
+ EFA39C081296658B00B36EBB /* AIFacebookXMPPService.h */,
+ EFA39C091296658B00B36EBB /* AIFacebookXMPPService.m */,
+ EFA39C2F12966B2600B36EBB /* AIFacebookXMPPOAuthWebViewWindowController.h */,
+ EFA39C3012966B2600B36EBB /* AIFacebookXMPPOAuthWebViewWindowController.m */,
+ EFA39CF512966F5D00B36EBB /* AIFacebookXMPPOauthWebViewWindow.xib */,
+ );
+ name = "FB XMPP";
+ sourceTree = "<group>";
+ };
F1D0C631051AC2380000000E /* Message Alias Support */ = {
isa = PBXGroup;
children = (
@@ -9453,6 +9545,7 @@
);
dependencies = (
340BAB4F09EC6FA7000EC441 /* PBXTargetDependency */,
+ EF34659713245CCB00CE4177 /* PBXTargetDependency */,
);
name = AdiumLibpurple;
productName = AdiumLibpurple;
@@ -9627,6 +9720,10 @@
ProjectRef = 346636860D41541A006C9034 /* FriBidi.xcodeproj */;
},
{
+ ProductGroup = EF3464AE1324593800CE4177 /* Products */;
+ ProjectRef = EF3464AD1324593800CE4177 /* JSON.xcodeproj */;
+ },
+ {
ProductGroup = 34D1AB520D693DEB00470520 /* Products */;
ProjectRef = 34D1AB510D693DEB00470520 /* RBSplitView.xcodeproj */;
},
@@ -9711,6 +9808,34 @@
remoteRef = 7E78DA9B0DD135DE00B9388F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ EF3464B61324593800CE4177 /* JSON.framework */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.framework;
+ path = JSON.framework;
+ remoteRef = EF3464B51324593800CE4177 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ EF3464B81324593800CE4177 /* Tests.octest */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.cfbundle;
+ path = Tests.octest;
+ remoteRef = EF3464B71324593800CE4177 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ EF3464BA1324593800CE4177 /* libjson.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libjson.a;
+ remoteRef = EF3464B91324593800CE4177 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ EF3464BC1324593800CE4177 /* libjsontests.octest */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.cfbundle;
+ path = libjsontests.octest;
+ remoteRef = EF3464BB1324593800CE4177 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
EFB1C3D80DDCA0A900B3973D /* LinkDriver.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
@@ -9791,6 +9916,8 @@
345D689A0F1FD56B002F2D01 /* facebook-small.png in Resources */,
1150A9960FBE48D600E0BD31 /* ESIRCAccountView.nib in Resources */,
1125DD3C0FF5A5D600544B92 /* PurpleFacebookAccountView.nib in Resources */,
+ 5A37D9091308A0B2000CE634 /* f_logo.png in Resources */,
+ 5A37D90A1308A0B7000CE634 /* f_logo_small.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -10054,6 +10181,8 @@
1130EA9E109B445D00FB3454 /* pref-messagealerts.png in Resources */,
11AE5555109CC88C0074BDC2 /* pref-confirmations.png in Resources */,
3490615D127F70B100FC313F /* TemporaryIRCAccountWindow.nib in Resources */,
+ EFA39C0B1296658B00B36EBB /* AIFacebookXMPPAccountView.xib in Resources */,
+ EFA39CF612966F5D00B36EBB /* AIFacebookXMPPOauthWebViewWindow.xib in Resources */,
1154E67912E12CB500B8CA27 /* AILogByAccountWindow.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -10360,6 +10489,10 @@
34064D100F21B34200AA6FE3 /* PurpleFacebookAccountViewController.m in Sources */,
346CE8071294B53F00439BF2 /* fbapi.c in Sources */,
346CE80A1294B59900439BF2 /* auth_fb.c in Sources */,
+ 5ACDB4DB1308729D0058322A /* AIFacebookXMPPAccount.m in Sources */,
+ 5ACDB4DD130872AB0058322A /* AIFacebookXMPPAccountViewController.m in Sources */,
+ 5ABEADCD1308889F00DA4C56 /* AIFacebookXMPPService.m in Sources */,
+ 5ABEADCE130888A800DA4C56 /* AIFacebookXMPPOAuthWebViewWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -11023,6 +11156,11 @@
target = F53C25AE0A2F95F100F7B73D /* Setup Build Directory */;
targetProxy = 63DE4C520F9C77D50034ED3A /* PBXContainerItemProxy */;
};
+ EF34659713245CCB00CE4177 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = JSON;
+ targetProxy = EF34659613245CCB00CE4177 /* PBXContainerItemProxy */;
+ };
F5B17CDF0A16C767004AE99E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = F5B17CCF0A16C6AC004AE99E /* Plist Macros */;
@@ -12815,6 +12953,8 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
+ "\"$(SRCROOT)/Frameworks/json-framework/build/Debug\"",
+ "\"$(SRCROOT)/build/Debug\"",
);
};
name = Debug;
@@ -12826,6 +12966,8 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
+ "\"$(SRCROOT)/Frameworks/json-framework/build/Debug\"",
+ "\"$(SRCROOT)/build/Debug\"",
);
};
name = Release;
@@ -12837,6 +12979,8 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
+ "\"$(SRCROOT)/Frameworks/json-framework/build/Debug\"",
+ "\"$(SRCROOT)/build/Debug\"",
);
};
name = "Release-Debug";
diff -r 378c29944977 -r f46d14768090 Frameworks/AutoHyperlinks Framework/AutoHyperlinks.framework.xcodeproj/project.pbxproj
--- a/Frameworks/AutoHyperlinks Framework/AutoHyperlinks.framework.xcodeproj/project.pbxproj Sat Mar 05 03:40:16 2011 +0200
+++ b/Frameworks/AutoHyperlinks Framework/AutoHyperlinks.framework.xcodeproj/project.pbxproj Sun Mar 06 17:09:40 2011 -0800
@@ -385,7 +385,14 @@
};
buildConfigurationList = DA8A8087085549EE00F24BB3 /* Build configuration list for PBXProject "AutoHyperlinks.framework" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 0867D691FE84028FC02AAC07 /* AIHyperlinks.framework */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
diff -r 378c29944977 -r f46d14768090 Frameworks/grab-github.zsh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/grab-github.zsh Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,20 @@
+#!/bin/zsh -f
+
+#Download an unversioned copy of the files in a GitHub repository.
+#Usage: grab-github username projectname commit-ID
+#The files will exist in a folder under the project name.
+#A file in the same folder named .github_commit_id will contain the commit ID of the version you grabbed. This is mainly useful when you're re-grabbing unchanged source with an updated commit ID, such as after a rebase.
+
+gh_user="$1"
+gh_project="$2"
+gh_commit="$3"
+
+if test -e "$gh_project"; then
+ echo "$gh_project already exists here - aborting" >> /dev/stderr
+ exit 1
+fi
+
+curl -L "http://github.com/$gh_user/$gh_project/tarball/$gh_commit" | tar xzf -
+
+mv "${gh_user}-${gh_project}-${gh_commit}" "$gh_project"
+echo "$gh_commit" > "$gh_project/.github_commit_id"
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/.github_commit_id
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/.github_commit_id Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,1 @@
+f56d63f
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/.gitignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/.gitignore Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,3 @@
+*.mode1v3
+*.pbxuser
+build
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Changes.markdown
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Changes.markdown Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,153 @@
+# JSON Framework Changes
+
+## Version 2.3.2 (January 10th, 2011)
+
+### Bug fixes
+
+* [Issue 13][#13]: Unable to open Targets. Fix bug introduced by trying to be clever and share PBXShellScriptBuildPhases in the project.pbxproj file.
+
+[#13]: http://github.com/stig/json-framework/issues/closed/#issue/13
+
+
+## Version 2.3.1 (September 25th, 2010)
+
+### Changes
+
+* Move to host releases on Github rather than Google code.
+* Renamed .md files to .markdown.
+* Removed bench target--use [Sam Soffes's benchmarks][json-benchmark] instead.
+* Releases are no longer a munged form of the source tree, but identical to the tagged source.
+
+[json-benchmark]: http://github.com/samsoffes/json-benchmark
+
+### Bug fixes
+
+* [Issue 2][issue#2]: Linkage not supported by default distribution.
+* [Issue 4][issue#4]: Writer reported to occasionally fail infinity check.
+* [Issue 8][issue#8]: Installation.markdown refers to missing JSON folder.
+
+[issue#2]: http://github.com/stig/json-framework/issues/closed/#issue/2
+[issue#4]: http://github.com/stig/json-framework/issues/closed/#issue/4
+[issue#8]: http://github.com/stig/json-framework/issues/closed/#issue/8
+
+## Version 2.3 (August 7, 2010)
+
+* Renamed README.md to Readme.md
+* Updated version number
+
+## Version 2.3beta1 (July 31, 2010)
+
+### Changes
+
+* **Parsing performance improvements.**
+[Issue 56][issue-56]: Dewvinci & Tobias Höhmann came up with a patch to improve parsing of short JSON texts with lots of numbers by over 60%.
+* **Refactored tests to be more data-driven.**
+This should make the source leaner and easier to maintain.
+* **Removed problematic SDK**
+[Issue 33][issue-33], [58][issue-58], [63][issue-63], and [64][issue-64]: The vast majority of the issues people are having with this framework were related to the somewhat mystical Custom SDK. This has been removed in this version.
+* **Removed the deprecated SBJSON facade**
+[Issue 71][issue-71]: You should use the SBJsonParser or SBJsonWriter classes, or the category methods, instead. This also let us remove the SBJsonParser and SBJsonWriter categories; these were only there to support the facade, but made the code less transparent.
+* **Removed the deprecated fragment support**
+[Issue 70][issue-70]: Fragments were a bad idea from the start, but deceptively useful while writing the framework's test suite. This has now been rectified.
+
+[issue-56]: http://code.google.com/p/json-framework/issues/detail?id=56
+[issue-33]: http://code.google.com/p/json-framework/issues/detail?id=33
+[issue-58]: http://code.google.com/p/json-framework/issues/detail?id=58
+[issue-63]: http://code.google.com/p/json-framework/issues/detail?id=63
+[issue-64]: http://code.google.com/p/json-framework/issues/detail?id=64
+[issue-70]: http://code.google.com/p/json-framework/issues/detail?id=70
+[issue-71]: http://code.google.com/p/json-framework/issues/detail?id=71
+
+
+### Bug Fixes
+
+* [Issue 38][issue-38]: Fixed header-inclusion issue.
+* [Issue 74][issue-74]: Fix bug in handling of Infinity, -Infinity & NaN.
+* [Issue 68][issue-68]: Fixed documentation bug
+
+[issue-38]: http://code.google.com/p/json-framework/issues/detail?id=39
+[issue-74]: http://code.google.com/p/json-framework/issues/detail?id=74
+[issue-68]: http://code.google.com/p/json-framework/issues/detail?id=68
+
+
+## Version 2.2.3 (March 7, 2010)
+
+* **Added -all_load to libjsontests linker flags.**
+This allows the tests to run with more recent versions of GCC.
+* **Unable to do a JSONRepresentation for a first-level proxy object.**
+[Issue 54][issue-54] & [60][issue-60]: Allow the -proxyForJson method to be called for first-level proxy objects, in addition to objects that are embedded in other objects.
+
+[issue-54]: http://code.google.com/p/json-framework/issues/detail?id=54
+[issue-60]: http://code.google.com/p/json-framework/issues/detail?id=60
+
+## Version 2.2.2 (September 12, 2009)
+
+* **Fixed error-reporting logic in category methods.**
+Reported by Mike Monaco.
+* **iPhone SDK built against iPhoneOS 3.0.**
+This has been updated from 2.2.1.
+
+## Version 2.2.1 (August 1st, 2009)
+
+* **Added svn:ignore property to build directory.**
+Requested by Rony Kubat.
+* **Fixed potential corruption in category methods.**
+If category methods were used in multiple threads they could potentially cause a crash. Reported by dprotaso / Relium.
+
+## Version 2.2 (June 6th, 2009)
+
+No changes since 2.2beta1.
+
+## Version 2.2beta1 (May 30th, 2009)
+
+* **Renamed method for custom object support**
+Renamed the -jsonRepresentationProxy method to -proxyForJson.
+
+## Version 2.2alpha5 (May 25th, 2009)
+
+* **Added support for custom objects (generation only)**
+Added an optional -jsonRepresentationProxy method that you can implement (either directly or as category) to enable JSON.framework to create a JSON representation of any object type. See the Tests/ProxyTest.m file for more information on how this works.
+* **Moved maxDepth to SBJsonBase**
+Throw errors when the input is nested too deep for writing json as well as parsing. This allows us to exit cleanly rather than break the stack if someone accidentally creates a recursive structure.
+
+## Version 2.2alpha4 (May 21st, 2009)
+
+* **Renamed protocols and moved method declarations**
+Renamed SBJsonWriterOptions and SBJsonParserOptions protocols to be the same as their primary implementations and moved their one public method there.
+* **Implemented proxy methods in SBJSON**
+This facade now implements the same methods as the SBJsonWriter and SBJsonParser objects, and simply forwards to them.
+* **Extracted private methods to private protocol**
+Don't use these please.
+* **Improved documentation generation**
+Classes now inherit documentation from their superclasses and protocols they implement.
+
+## Version 2.2alpha3 (May 16th, 2009)
+
+* **Reintroduced the iPhone Custom SDK**
+For the benefit of users who prefer not to copy the JSON source files into their project. Also updated it to be based on iPhoneOS v2.2.1.
+* **Deprecated methods for dealing with fragments**
+Tweaked the new interface classes to support the old fragment-methods one more version.
+
+## Version 2.2alpha2 (May 11th, 2009)
+
+* **Added a Changes file.**
+So people can see what the changes are for each version without having to go to the project home page.
+* **Updated Credits.**
+Some people that have provided patches (or other valuable contributions) had been left out. I've done my best to add those in. (If you feel that you or someone else are still missing, please let me know.)
+* **Removed .svn folders from distribution.**
+The JSON source folder had a .svn folder in it, which could have caused problems when dragging it into your project.
+
+## Version 2.2alpha1 (May 10th, 2009)
+
+* **Improved installation instructions, particularly for the iPhone.**
+Getting the SDK to work properly in all configurations has proved to be a headache. Therefore the SDK has been removed in favour of instructions for simply copying the source files into your project.
+* **Split the SBJSON class into a writer and parser class.**
+SBJSON remains as a facade for backwards compatibility. This refactoring also quashed warnings reported by the Clang static analyser.
+* **Improved interface for dealing with errors.**
+Rather than having to pass in a pointer to an NSError object, you can now simply call a method to get the error stack back if there was an error. (The NSError-based API remains in the SBJSON facade, but is not present in the new classes.)
+* **Documentation updates.**
+Minor updates to the documentation.
+
+Release notes for earlier releases can be found here:
+http://code.google.com/p/json-framework/wiki/ReleaseNotes
+
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/JSON.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/JSON.h Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,65 @@
+/*
+ Copyright (C) 2009-2010 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ @mainpage A strict JSON parser and generator for Objective-C
+
+ JSON (JavaScript Object Notation) is a lightweight data-interchange
+ format. This framework provides two apis for parsing and generating
+ JSON. One standard object-based and a higher level api consisting of
+ categories added to existing Objective-C classes.
+
+ This framework does its best to be as strict as possible, both in what it accepts and what it generates. For example, it does not support trailing commas in arrays or objects. Nor does it support embedded comments, or anything else not in the JSON specification. This is considered a feature.
+
+ @section Links
+
+ @li <a href="http://stig.github.com/json-framework">Project home page</a>.
+ @li Online version of the <a href="http://stig.github.com/json-framework/api">API documentation</a>.
+
+*/
+
+
+// This setting of 1 is best if you copy the source into your project.
+// The build transforms the 1 to a 0 when building the framework and static lib.
+
+#if 1
+
+#import "SBJsonParser.h"
+#import "SBJsonWriter.h"
+#import "NSObject+SBJSON.h"
+#import "NSString+SBJSON.h"
+
+#else
+
+#import <JSON/SBJsonParser.h>
+#import <JSON/SBJsonWriter.h>
+#import <JSON/NSObject+SBJSON.h>
+#import <JSON/NSString+SBJSON.h>
+
+#endif
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/NSObject+SBJSON.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/NSObject+SBJSON.h Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,53 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+
+/**
+ @brief Adds JSON generation to Foundation classes
+
+ This is a category on NSObject that adds methods for returning JSON representations
+ of standard objects to the objects themselves. This means you can call the
+ -JSONRepresentation method on an NSArray object and it'll do what you want.
+ */
+ at interface NSObject (NSObject_SBJSON)
+
+/**
+ @brief Returns a string containing the receiver encoded in JSON.
+
+ This method is added as a category on NSObject but is only actually
+ supported for the following objects:
+ @li NSDictionary
+ @li NSArray
+ */
+- (NSString *)JSONRepresentation;
+
+ at end
+
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/NSObject+SBJSON.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/NSObject+SBJSON.m Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "NSObject+SBJSON.h"
+#import "SBJsonWriter.h"
+
+ at implementation NSObject (NSObject_SBJSON)
+
+- (NSString *)JSONRepresentation {
+ SBJsonWriter *jsonWriter = [SBJsonWriter new];
+ NSString *json = [jsonWriter stringWithObject:self];
+ if (!json)
+ NSLog(@"-JSONRepresentation failed. Error trace is: %@", [jsonWriter errorTrace]);
+ [jsonWriter release];
+ return json;
+}
+
+ at end
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/NSString+SBJSON.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/NSString+SBJSON.h Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ @brief Adds JSON parsing methods to NSString
+
+This is a category on NSString that adds methods for parsing the target string.
+*/
+ at interface NSString (NSString_SBJSON)
+
+/**
+ @brief Returns the NSDictionary or NSArray represented by the current string's JSON representation.
+
+ Returns the dictionary or array represented in the receiver, or nil on error.
+
+ Returns the NSDictionary or NSArray represented by the current string's JSON representation.
+ */
+- (id)JSONValue;
+
+ at end
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/NSString+SBJSON.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/NSString+SBJSON.m Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2007-2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "NSString+SBJSON.h"
+#import "SBJsonParser.h"
+
+ at implementation NSString (NSString_SBJSON)
+
+- (id)JSONValue
+{
+ SBJsonParser *jsonParser = [SBJsonParser new];
+ id repr = [jsonParser objectWithString:self];
+ if (!repr)
+ NSLog(@"-JSONValue failed. Error trace is: %@", [jsonParser errorTrace]);
+ [jsonParser release];
+ return repr;
+}
+
+ at end
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/SBJsonBase.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/SBJsonBase.h Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+extern NSString * SBJSONErrorDomain;
+
+
+enum {
+ EUNSUPPORTED = 1,
+ EPARSENUM,
+ EPARSE,
+ EFRAGMENT,
+ ECTRL,
+ EUNICODE,
+ EDEPTH,
+ EESCAPE,
+ ETRAILCOMMA,
+ ETRAILGARBAGE,
+ EEOF,
+ EINPUT
+};
+
+/**
+ @brief Common base class for parsing & writing.
+
+ This class contains the common error-handling code and option between the parser/writer.
+ */
+ at interface SBJsonBase : NSObject {
+ NSMutableArray *errorTrace;
+
+ at protected
+ NSUInteger depth, maxDepth;
+}
+
+/**
+ @brief The maximum recursing depth.
+
+ Defaults to 512. If the input is nested deeper than this the input will be deemed to be
+ malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can
+ turn off this security feature by setting the maxDepth value to 0.
+ */
+ at property NSUInteger maxDepth;
+
+/**
+ @brief Return an error trace, or nil if there was no errors.
+
+ Note that this method returns the trace of the last method that failed.
+ You need to check the return value of the call you're making to figure out
+ if the call actually failed, before you know call this method.
+ */
+ @property(copy,readonly) NSArray* errorTrace;
+
+/// @internal for use in subclasses to add errors to the stack trace
+- (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str;
+
+/// @internal for use in subclasess to clear the error before a new parsing attempt
+- (void)clearErrorTrace;
+
+ at end
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/SBJsonBase.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/SBJsonBase.m Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "SBJsonBase.h"
+NSString * SBJSONErrorDomain = @"org.brautaset.JSON.ErrorDomain";
+
+
+ at implementation SBJsonBase
+
+ at synthesize errorTrace;
+ at synthesize maxDepth;
+
+- (id)init {
+ self = [super init];
+ if (self)
+ self.maxDepth = 512;
+ return self;
+}
+
+- (void)dealloc {
+ [errorTrace release];
+ [super dealloc];
+}
+
+- (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str {
+ NSDictionary *userInfo;
+ if (!errorTrace) {
+ errorTrace = [NSMutableArray new];
+ userInfo = [NSDictionary dictionaryWithObject:str forKey:NSLocalizedDescriptionKey];
+
+ } else {
+ userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+ str, NSLocalizedDescriptionKey,
+ [errorTrace lastObject], NSUnderlyingErrorKey,
+ nil];
+ }
+
+ NSError *error = [NSError errorWithDomain:SBJSONErrorDomain code:code userInfo:userInfo];
+
+ [self willChangeValueForKey:@"errorTrace"];
+ [errorTrace addObject:error];
+ [self didChangeValueForKey:@"errorTrace"];
+}
+
+- (void)clearErrorTrace {
+ [self willChangeValueForKey:@"errorTrace"];
+ [errorTrace release];
+ errorTrace = nil;
+ [self didChangeValueForKey:@"errorTrace"];
+}
+
+ at end
diff -r 378c29944977 -r f46d14768090 Frameworks/json-framework/Classes/SBJsonParser.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/json-framework/Classes/SBJsonParser.h Sun Mar 06 17:09:40 2011 -0800
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of the author nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+#import "SBJsonBase.h"
+
+/**
+ @brief The JSON parser class.
+
+ JSON is mapped to Objective-C types in the following way:
+
+ @li Null -> NSNull
+ @li String -> NSMutableString
+ @li Array -> NSMutableArray
+ @li Object -> NSMutableDictionary
+ @li Boolean -> NSNumber (initialised with -initWithBool:)
+ @li Number -> (NSNumber | NSDecimalNumber)
+
+ Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber
+ instances. These are initialised with the -initWithBool: method, and
+ round-trip back to JSON properly. (They won't silently suddenly become 0 or 1; they'll be
+ represented as 'true' and 'false' again.)
+
+ As an optimisation short JSON integers turn into NSNumber instances, while complex ones turn into NSDecimalNumber instances.
+ We can thus avoid any loss of precision as JSON allows ridiculously large numbers.
More information about the commits
mailing list