summaryrefslogtreecommitdiffstats
path: root/Classes/Source/Experimental/CJSONSerialization.h
blob: 83c9bb2bf41ebe1b88d01753984e2fe1b9d7b468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
//  CJSONSerialization.h
//  TouchJSON
//
//  Created by Jonathan Wight on 03/04/11.
//  Copyright 2011 toxicsoftware.com. All rights reserved.
//

#import <Foundation/Foundation.h>

enum {
    kCJSONReadingMutableContainers = 0x1,
    kCJSONReadingMutableLeaves = 0x2,
    kCJSONReadingAllowFragments = 0x04,
};
typedef NSUInteger EJSONReadingOptions;

enum {
    kCJJSONWritingPrettyPrinted = 0x1
};
typedef NSUInteger EJSONWritingOptions;


@interface CJSONSerialization : NSObject {
    
}

+ (BOOL)isValidJSONObject:(id)obj;
+ (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error;
+ (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error;
+ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error;
+ (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error;

@end