Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions JSONKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ typedef unsigned int NSUInteger;
#ifndef _JSONKIT_H_
#define _JSONKIT_H_

// You can define JK_REMOVE_DEPRECATED to remove all deprecated stuff
//#define JK_REMOVE_DEPRECATED

#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
Expand Down Expand Up @@ -148,12 +151,14 @@ typedef struct JKParseState JKParseState; // Opaque internal, private type.
- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
- (void)clearCache;

#ifndef JK_REMOVE_DEPRECATED
// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead.
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length:error: instead.
// The NSData MUST be UTF8 encoded JSON.
- (id)parseJSONData:(NSData *)jsonData JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData: instead.
- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData:error: instead.
#endif

// Methods that return immutable collection objects.
- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
Expand Down
2 changes: 2 additions & 0 deletions JSONKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,7 @@ static id _JKParseUTF8String(JKParseState *parseState, BOOL mutableCollections,
#pragma mark Deprecated as of v1.4
////////////

#ifndef JK_REMOVE_DEPRECATED
// Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead.
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length
{
Expand All @@ -2226,6 +2227,7 @@ - (id)parseJSONData:(NSData *)jsonData error:(NSError **)error
{
return([self objectWithData:jsonData error:error]);
}
#endif

////////////
#pragma mark Methods that return immutable collection objects
Expand Down