Permalink
Browse files

- fixed paths with sample application

- fixed few bugs in SDK
  • Loading branch information...
1 parent 7bd8807 commit 85541c32c674dfdec707eb34f5ff2841af043549 Robin Raymond committed Jan 9, 2013
Showing with 3,352 additions and 203 deletions.
  1. +2 −0 .gitignore
  2. +69 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/JSON.h
  3. +61 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/NSObject+JSON.h
  4. +60 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/NSObject+JSON.m
  5. +113 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonParser.h
  6. +120 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonParser.m
  7. +135 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParser.h
  8. +294 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParser.m
  9. +88 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParserAdapter.h
  10. +171 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParserAdapter.m
  11. +89 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParserState.h
  12. +370 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamParserState.m
  13. +163 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamWriter.h
  14. +372 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamWriter.m
  15. +75 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamWriterState.h
  16. +132 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonStreamWriterState.m
  17. +69 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonTokeniser.h
  18. +476 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonTokeniser.m
  19. +132 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonWriter.h
  20. +102 −0 Samples/OpenPeerSampleApp/3rdParties/SBJSON/SBJsonWriter.m
  21. 0 Samples/OpenPeerSampleApp/{OpenPeerSampleApp → 3rdParties/XMLWriter}/XMLWriter.h
  22. 0 Samples/OpenPeerSampleApp/{OpenPeerSampleApp → 3rdParties/XMLWriter}/XMLWriter.m
  23. +105 −87 Samples/OpenPeerSampleApp/OpenPeerSampleApp.xcodeproj/project.pbxproj
  24. +36 −20 Samples/OpenPeerSampleApp/OpenPeerSampleApp/ActiveSessionViewController.m
  25. +2 −1 Samples/OpenPeerSampleApp/OpenPeerSampleApp/ActiveSessionViewController.xib
  26. +7 −4 Samples/OpenPeerSampleApp/OpenPeerSampleApp/CallDelegate.m
  27. +9 −2 Samples/OpenPeerSampleApp/OpenPeerSampleApp/LoginManager.m
  28. +3 −2 Samples/OpenPeerSampleApp/OpenPeerSampleApp/MainViewController.h
  29. +1 −0 Samples/OpenPeerSampleApp/OpenPeerSampleApp/SessionManager.h
  30. +69 −1 Samples/OpenPeerSampleApp/OpenPeerSampleApp/SessionManager.m
  31. +1 −1 Samples/OpenPeerSampleApp/OpenPeerSampleApp/Utility.h
  32. +3 −2 Samples/OpenPeerSampleApp/OpenPeerSampleApp/Utility.m
  33. +10 −16 openpeer-ios-sdk.xcodeproj/project.pbxproj
  34. +0 −21 openpeer-ios-sdk/internal/OpenPeerStorageManager.h
  35. +2 −0 openpeer-ios-sdk/internal/source/OpenPeerAccountIdentityLookupQueryDelegate.mm
  36. +4 −0 openpeer-ios-sdk/internal/source/OpenPeerAccountPeerFileLookupQueryDelegate.mm
  37. +5 −1 openpeer-ios-sdk/internal/source/OpenPeerCallDelegate.mm
  38. +2 −1 openpeer-ios-sdk/internal/source/OpenPeerConversationThreadDelegate.mm
  39. +0 −44 openpeer-ios-sdk/internal/source/OpenPeerStorageManager.mm
View
@@ -0,0 +1,2 @@
+xcuserdata
+.DS_Store
@@ -0,0 +1,69 @@
+/*
+ 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 "SBJsonStreamWriter.h"
+#import "SBJsonStreamParser.h"
+#import "SBJsonStreamParserAdapter.h"
+#import "NSObject+JSON.h"
+
+#else
+
+#import <JSON/SBJsonParser.h>
+#import <JSON/SBJsonWriter.h>
+#import <JSON/SBJsonStreamParser.h>
+#import <JSON/SBJsonStreamParserAdapter.h>
+#import <JSON/SBJsonStreamWriter.h>
+#import <JSON/NSObject+JSON.h>
+
+#endif
@@ -0,0 +1,61 @@
+/*
+ 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>
+
+#pragma mark JSON Writing
+
+/// Adds JSON generation to NSArray
+@interface NSArray (NSArray_SBJsonWriting)
+
+/// Returns a string containing the receiver encoded in JSON.
+- (NSString *)JSONRepresentation;
+
+@end
+
+
+/// Adds JSON generation to NSArray
+@interface NSDictionary (NSDictionary_SBJsonWriting)
+
+/// Returns a string containing the receiver encoded in JSON.
+- (NSString *)JSONRepresentation;
+
+@end
+
+#pragma mark JSON Parsing
+
+/// Adds JSON parsing methods to NSString
+@interface NSString (NSString_SBJsonParsing)
+
+/// Returns the NSDictionary or NSArray represented by the receiver's JSON representation, or nil on error
+- (id)JSONValue;
+
+@end
+
+
@@ -0,0 +1,60 @@
+/*
+ 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+JSON.h"
+#import "SBJsonWriter.h"
+#import "SBJsonParser.h"
+
+@implementation NSObject (NSObject_SBJsonWriting)
+
+- (NSString *)JSONRepresentation {
+ SBJsonWriter *jsonWriter = [SBJsonWriter new];
+ NSString *json = [jsonWriter stringWithObject:self];
+ if (!json)
+ NSLog(@"-JSONRepresentation failed. Error is: %@", jsonWriter.error);
+ [jsonWriter release];
+ return json;
+}
+
+@end
+
+
+
+@implementation NSString (NSString_SBJsonParsing)
+
+- (id)JSONValue {
+ SBJsonParser *jsonParser = [SBJsonParser new];
+ id repr = [jsonParser objectWithString:self];
+ if (!repr)
+ NSLog(@"-JSONValue failed. Error is: %@", jsonParser.error);
+ [jsonParser release];
+ return repr;
+}
+
+@end
@@ -0,0 +1,113 @@
+/*
+ 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 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.
+
+ */
+
+@interface SBJsonParser : NSObject {
+ id value;
+ NSString *error;
+ 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.
+ */
+@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) NSString *error;
+
+/**
+ @brief Return the object represented by the given NSData object.
+
+ The data *must* be UTF8 encoded.
+ @param data the data to parse.
+
+ */
+- (id)objectWithData:(NSData*)data;
+
+/**
+ @brief Return the object represented by the given string
+
+ Returns the object represented by the passed-in string or nil on error. The returned object can be
+ a string, number, boolean, null, array or dictionary.
+
+ @param repr the json string to parse
+ */
+- (id)objectWithString:(NSString *)repr;
+
+/**
+ @brief Return the object represented by the given string
+
+ Returns the object represented by the passed-in string or nil on error. The returned object can be
+ a string, number, boolean, null, array or dictionary.
+
+ @param jsonText the json string to parse
+ @param error pointer to an NSError object to populate on error
+ */
+
+- (id)objectWithString:(NSString*)jsonText
+ error:(NSError**)error;
+
+@end
+
+
Oops, something went wrong.

0 comments on commit 85541c3

Please sign in to comment.