Permalink
Browse files

JSONDeserializer might as well use CJSONScanner error codes.

  • Loading branch information...
1 parent 28f1b2c commit f6c80e6b09f7942aa14bc6955b3f5b5207eec292 @schwa schwa committed Mar 4, 2011
@@ -16,7 +16,7 @@ - (void)deserializeAsDictionary:(NSData *)inData completionBlock:(void (^)(id re
NSError *noDataError = nil;
if (inData == NULL || [inData length] == 0) {
- noDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:CJSONDeserializerErrorNothingToScan userInfo:NULL];
+ noDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL];
block(nil, noDataError);
}
@@ -40,7 +40,7 @@ - (void)deserializeAsArray:(NSData *)inData completionBlock:(void (^)(id result,
NSError *nullInDataError = nil;
if (inData == NULL || [inData length] == 0) {
- nullInDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:CJSONDeserializerErrorNothingToScan userInfo:NULL];
+ nullInDataError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL];
block(nil, nullInDataError);
}
@@ -31,10 +31,6 @@
extern NSString *const kJSONDeserializerErrorDomain /* = @"CJSONDeserializerErrorDomain" */;
-typedef enum {
- CJSONDeserializerErrorNothingToScan = -1
-} CJSONDeserializerErrorCode;
-
@class CJSONScanner;
@interface CJSONDeserializer : NSObject {
@@ -102,7 +102,7 @@ - (id)deserialize:(NSData *)inData error:(NSError **)outError
if (inData == NULL || [inData length] == 0)
{
if (outError)
- *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:CJSONDeserializerErrorNothingToScan userInfo:NULL];
+ *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL];
return(NULL);
}
@@ -122,7 +122,7 @@ - (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError
if (inData == NULL || [inData length] == 0)
{
if (outError)
- *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:CJSONDeserializerErrorNothingToScan userInfo:NULL];
+ *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL];
return(NULL);
}
@@ -142,7 +142,7 @@ - (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError
if (inData == NULL || [inData length] == 0)
{
if (outError)
- *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:CJSONDeserializerErrorNothingToScan userInfo:NULL];
+ *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:kJSONScannerErrorCode_NothingToScan userInfo:NULL];
return(NULL);
}

0 comments on commit f6c80e6

Please sign in to comment.