Frameworks/JSONKit/JSONKit.h
author Evan Schoenberg
Thu, 14 Nov 2019 20:52:11 -0500
branchadium-1.5.11-merge
changeset 6013 f8d0dc659e3f
parent 4611 a80e9a099697
parent 5967 558472b2039b
permissions -rw-r--r--
Merge 10.5.10.3 through 10.5.10.5 into 10.5.11!
5967
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     1
//
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     2
//  JSONKit.h
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     3
//  http://github.com/johnezang/JSONKit
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     4
//  Dual licensed under either the terms of the BSD License, or alternatively
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     5
//  under the terms of the Apache License, Version 2.0, as specified below.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     6
//
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     7
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     8
/*
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
     9
 Copyright (c) 2011, John Engelhart
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    10
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    11
 All rights reserved.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    12
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    13
 Redistribution and use in source and binary forms, with or without
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    14
 modification, are permitted provided that the following conditions are met:
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    15
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    16
 * Redistributions of source code must retain the above copyright
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    17
 notice, this list of conditions and the following disclaimer.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    18
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    19
 * Redistributions in binary form must reproduce the above copyright
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    20
 notice, this list of conditions and the following disclaimer in the
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    21
 documentation and/or other materials provided with the distribution.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    22
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    23
 * Neither the name of the Zang Industries nor the names of its
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    24
 contributors may be used to endorse or promote products derived from
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    25
 this software without specific prior written permission.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    26
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    27
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    28
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    29
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    30
 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    31
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    32
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    33
 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    34
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    35
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    36
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    37
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    38
*/
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    39
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    40
/*
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    41
 Copyright 2011 John Engelhart
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    42
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    43
 Licensed under the Apache License, Version 2.0 (the "License");
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    44
 you may not use this file except in compliance with the License.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    45
 You may obtain a copy of the License at
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    46
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    47
 http://www.apache.org/licenses/LICENSE-2.0
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    48
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    49
 Unless required by applicable law or agreed to in writing, software
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    50
 distributed under the License is distributed on an "AS IS" BASIS,
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    51
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    52
 See the License for the specific language governing permissions and
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    53
 limitations under the License.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    54
*/
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    55
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    56
#include <stddef.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    57
#include <stdint.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    58
#include <limits.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    59
#include <TargetConditionals.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    60
#include <AvailabilityMacros.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    61
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    62
#ifdef    __OBJC__
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    63
#import <Foundation/NSArray.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    64
#import <Foundation/NSData.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    65
#import <Foundation/NSDictionary.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    66
#import <Foundation/NSError.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    67
#import <Foundation/NSObjCRuntime.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    68
#import <Foundation/NSString.h>
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    69
#endif // __OBJC__
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    70
 
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    71
#ifdef __cplusplus
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    72
extern "C" {
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    73
#endif
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    74
  
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    75
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    76
// For Mac OS X < 10.5.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    77
#ifndef   NSINTEGER_DEFINED
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    78
#define   NSINTEGER_DEFINED
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    79
#if       defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    80
typedef long           NSInteger;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    81
typedef unsigned long  NSUInteger;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    82
#define NSIntegerMin   LONG_MIN
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    83
#define NSIntegerMax   LONG_MAX
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    84
#define NSUIntegerMax  ULONG_MAX
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    85
#else  // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    86
typedef int            NSInteger;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    87
typedef unsigned int   NSUInteger;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    88
#define NSIntegerMin   INT_MIN
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    89
#define NSIntegerMax   INT_MAX
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    90
#define NSUIntegerMax  UINT_MAX
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    91
#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    92
#endif // NSINTEGER_DEFINED
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    93
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    94
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    95
#ifndef _JSONKIT_H_
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    96
#define _JSONKIT_H_
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    97
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    98
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
    99
#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   100
#else
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   101
#define JK_DEPRECATED_ATTRIBUTE
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   102
#endif
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   103
  
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   104
#define JSONKIT_VERSION_MAJOR 1
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   105
#define JSONKIT_VERSION_MINOR 4
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   106
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   107
typedef NSUInteger JKFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   108
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   109
/*
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   110
  JKParseOptionComments        : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   111
  JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   112
  JKParseOptionLooseUnicode    : Normally the decoder will stop with an error at any malformed Unicode.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   113
                                 This option allows JSON with malformed Unicode to be parsed without reporting an error.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   114
                                 Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER".
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   115
 */
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   116
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   117
enum {
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   118
  JKParseOptionNone                     = 0,
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   119
  JKParseOptionStrict                   = 0,
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   120
  JKParseOptionComments                 = (1 << 0),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   121
  JKParseOptionUnicodeNewlines          = (1 << 1),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   122
  JKParseOptionLooseUnicode             = (1 << 2),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   123
  JKParseOptionPermitTextAfterValidJSON = (1 << 3),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   124
  JKParseOptionValidFlags               = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   125
};
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   126
typedef JKFlags JKParseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   127
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   128
enum {
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   129
  JKSerializeOptionNone                 = 0,
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   130
  JKSerializeOptionPretty               = (1 << 0),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   131
  JKSerializeOptionEscapeUnicode        = (1 << 1),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   132
  JKSerializeOptionEscapeForwardSlashes = (1 << 4),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   133
  JKSerializeOptionValidFlags           = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   134
};
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   135
typedef JKFlags JKSerializeOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   136
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   137
#ifdef    __OBJC__
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   138
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   139
typedef struct JKParseState JKParseState; // Opaque internal, private type.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   140
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   141
// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   142
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   143
@interface JSONDecoder : NSObject {
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   144
  JKParseState *parseState;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   145
}
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   146
+ (id)decoder;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   147
+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   148
- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   149
- (void)clearCache;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   150
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   151
// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   152
- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length                         JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:        instead.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   153
- (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.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   154
// The NSData MUST be UTF8 encoded JSON.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   155
- (id)parseJSONData:(NSData *)jsonData                                                            JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:                     instead.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   156
- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error                                    JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:error:               instead.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   157
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   158
// Methods that return immutable collection objects.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   159
- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   160
- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   161
// The NSData MUST be UTF8 encoded JSON.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   162
- (id)objectWithData:(NSData *)jsonData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   163
- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   164
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   165
// Methods that return mutable collection objects.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   166
- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   167
- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   168
// The NSData MUST be UTF8 encoded JSON.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   169
- (id)mutableObjectWithData:(NSData *)jsonData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   170
- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   171
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   172
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   173
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   174
////////////
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   175
#pragma mark Deserializing methods
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   176
////////////
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   177
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   178
@interface NSString (JSONKitDeserializing)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   179
- (id)objectFromJSONString;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   180
- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   181
- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   182
- (id)mutableObjectFromJSONString;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   183
- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   184
- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   185
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   186
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   187
@interface NSData (JSONKitDeserializing)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   188
// The NSData MUST be UTF8 encoded JSON.
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   189
- (id)objectFromJSONData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   190
- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   191
- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   192
- (id)mutableObjectFromJSONData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   193
- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   194
- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   195
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   196
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   197
////////////
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   198
#pragma mark Serializing methods
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   199
////////////
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   200
  
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   201
@interface NSString (JSONKitSerializing)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   202
// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can "serialize to JSON" just the NSString).
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   203
// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes:
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   204
// includeQuotes:YES `a "test"...` -> `"a \"test\"..."`
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   205
// includeQuotes:NO  `a "test"...` -> `a \"test\"...`
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   206
- (NSData *)JSONData;     // Invokes JSONDataWithOptions:JKSerializeOptionNone   includeQuotes:YES
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   207
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   208
- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   209
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   210
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   211
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   212
@interface NSArray (JSONKitSerializing)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   213
- (NSData *)JSONData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   214
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   215
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   216
- (NSString *)JSONString;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   217
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   218
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   219
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   220
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   221
@interface NSDictionary (JSONKitSerializing)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   222
- (NSData *)JSONData;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   223
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   224
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   225
- (NSString *)JSONString;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   226
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   227
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   228
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   229
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   230
#ifdef __BLOCKS__
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   231
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   232
@interface NSArray (JSONKitSerializingBlockAdditions)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   233
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   234
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   235
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   236
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   237
@interface NSDictionary (JSONKitSerializingBlockAdditions)
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   238
- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   239
- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   240
@end
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   241
  
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   242
#endif
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   243
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   244
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   245
#endif // __OBJC__
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   246
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   247
#endif // _JSONKIT_H_
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   248
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   249
#ifdef __cplusplus
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   250
}  // extern "C"
558472b2039b Backed out changeset e48bfdcf9f20, restoring Facebook and JSONKit.
Thijs Alkemade <me@thijsalkema.de>
parents:
diff changeset
   251
#endif