@@ -21,12 +21,13 @@ #import "OFData.h" #import "OFInvalidArgumentException.h" @interface OFNull () -- (OFString *)of_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth; +- (OFString *) + of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options + depth: (size_t)depth; @end static OFNull *null = nil; @implementation OFNull @@ -47,11 +48,11 @@ [self release]; pool = objc_autoreleasePoolPush(); if (![element.name isEqual: self.className] || - ![element.namespace isEqual: OF_SERIALIZATION_NS]) + ![element.namespace isEqual: OFSerializationNS]) @throw [OFInvalidArgumentException exception]; objc_autoreleasePoolPop(pool); return [OFNull null]; @@ -71,11 +72,11 @@ { void *pool = objc_autoreleasePoolPush(); OFXMLElement *element; element = [OFXMLElement elementWithName: self.className - namespace: OF_SERIALIZATION_NS]; + namespace: OFSerializationNS]; [element retain]; objc_autoreleasePoolPop(pool); @@ -82,40 +83,30 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self of_JSONRepresentationWithOptions: 0 - depth: 0]; + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } -- (OFString *)JSONRepresentationWithOptions: (int)options +- (OFString *)JSONRepresentationWithOptions: + (OFJSONRepresentationOptions)options { - return [self of_JSONRepresentationWithOptions: options - depth: 0]; + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)of_JSONRepresentationWithOptions: (int)options +- (OFString *) + of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options depth: (size_t)depth { return @"null"; } - (OFData *)messagePackRepresentation { uint8_t type = 0xC0; - - return [OFData dataWithItems: &type - count: 1]; -} - -- (OFData *)ASN1DERRepresentation -{ - const unsigned char bytes[] = { OF_ASN1_TAG_NUMBER_NULL, 0 }; - - return [OFData dataWithItems: bytes - count: sizeof(bytes)]; + return [OFData dataWithItems: &type count: 1]; } - (instancetype)autorelease { return self; @@ -130,13 +121,13 @@ { } - (unsigned int)retainCount { - return OF_RETAIN_COUNT_MAX; + return OFMaxRetainCount; } - (void)dealloc { OF_DEALLOC_UNSUPPORTED } @end