Chromium Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

13 years ago
  1. //
  2. // MGMJSON.h
  3. // MGMUsers
  4. //
  5. // Created by Mr. Gecko on 7/31/10.
  6. // Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSString (MGMJSON)
  10. - (id)parseJSON;
  11. - (NSString *)JSONValue;
  12. @end
  13. @interface NSData (MGMJSON)
  14. - (id)parseJSON;
  15. @end
  16. @interface NSNumber (MGMJSON)
  17. - (NSString *)JSONValue;
  18. @end
  19. @interface NSNull (MGMJSON)
  20. - (NSString *)JSONValue;
  21. @end
  22. @interface NSDictionary (MGMJSON)
  23. - (NSString *)JSONValue;
  24. @end
  25. @interface NSArray (MGMJSON)
  26. - (NSString *)JSONValue;
  27. @end
  28. @interface MGMJSON : NSObject {
  29. @private
  30. NSMutableCharacterSet *escapeSet;
  31. NSString *JSONString;
  32. unsigned long position;
  33. unsigned long length;
  34. }
  35. - (id)initWithString:(NSString *)theString;
  36. - (id)parse;
  37. - (void)skipWhitespace;
  38. - (void)skipDigits;
  39. - (id)parseForObject;
  40. - (NSDictionary *)parseForDictionary;
  41. - (NSArray *)parseForArray;
  42. - (NSString *)parseForString;
  43. - (unichar)parseForUnicodeChar;
  44. - (NSNumber *)parseForYES;
  45. - (id)parseForNONULL;
  46. - (NSNumber *)parseForNumber;
  47. - (NSString *)convert:(id)theObject;
  48. - (NSString *)writeString:(NSString *)theString;
  49. - (NSString *)writeNumber:(NSNumber *)theNumber;
  50. - (NSString *)writeBool:(NSNumber *)theNumber;
  51. - (NSString *)writeNull:(NSNull *)theNull;
  52. - (NSString *)writeDictionary:(NSDictionary *)theDictionary;
  53. - (NSString *)writeArray:(NSArray *)theArray;
  54. @end