/*---------------------------------------------------------------------------*/
/* JsonIo.h                                                                  */
/* copyright (c) innovaphone 2015                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

@interface JsonIo : NSObject

#define JSON_ID_ROOT            0xffff
#define JSON_ID_NONE            0xffff
#define JSON_TYPE_ANY           0xff
		
@property (copy) void (^reset)(void);
@property (copy) int (^add)(int type, int flags, int base, NSString *name, NSString *info);
@property (copy) int (^add_object)(int base, NSString *name);
@property (copy) int (^add_array)(int base, NSString *name);
@property (copy) void (^add_string)(int base, NSString *name, NSString *value);
@property (copy) void (^add_json)(int base, NSString *name, NSString *value);
@property (copy) void (^add_int)(int base, NSString *name, int c);
@property (copy) void (^add_unsigned)(int base, NSString *name, int c);
@property (copy) void (^add_bool)(int base, NSString *name, bool value);
@property (copy) int (^encode_to_string)(int current, NSMutableString *str);
@property (copy) void (^encode)(NSMutableString *str);
@property (copy) word (^get_first)(byte type, word base);
@property (copy) word (^get_next)(byte type, word base, word last);
@property (copy) word (^get_id)(byte type, word base, byte flags, NSString *name);
@property (copy) NSString * (^get_value)(word base, byte flags, NSString *name);
@property (copy) word (^get_object)(word base, NSString *name);
@property (copy) word (^get_array)(word base, NSString *name);
@property (copy) NSString * (^get_string)(word base, NSString *name);
@property (copy) bool (^decode)(NSString *p);

+ (id) jsonIo;

- (id) init;

@end
