/vendor/TouchJSON/Experimental/CJSONSerialization.h

http://github.com/tgunr/passengerpane · C Header · 34 lines · 19 code · 8 blank · 7 comment · 0 complexity · 3c80b016d1a39e2be86a6591d9d1db5d MD5 · raw file

  1. //
  2. // CJSONSerialization.h
  3. // TouchJSON
  4. //
  5. // Created by Jonathan Wight on 03/04/11.
  6. // Copyright 2011 toxicsoftware.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. enum {
  10. kCJSONReadingMutableContainers = 0x1,
  11. kCJSONReadingMutableLeaves = 0x2,
  12. kCJSONReadingAllowFragments = 0x04,
  13. };
  14. typedef NSUInteger EJSONReadingOptions;
  15. enum {
  16. kCJJSONWritingPrettyPrinted = 0x1
  17. };
  18. typedef NSUInteger EJSONWritingOptions;
  19. @interface CJSONSerialization : NSObject {
  20. }
  21. + (BOOL)isValidJSONObject:(id)obj;
  22. + (NSData *)dataWithJSONObject:(id)obj options:(EJSONWritingOptions)opt error:(NSError **)error;
  23. + (id)JSONObjectWithData:(NSData *)data options:(EJSONReadingOptions)opt error:(NSError **)error;
  24. + (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(EJSONWritingOptions)opt error:(NSError **)error;
  25. + (id)JSONObjectWithStream:(NSInputStream *)stream options:(EJSONReadingOptions)opt error:(NSError **)error;
  26. @end