Permalink
Browse files

Updating to 1.0.11; Added test for snowflake; Fixed strict precision …

…overflow test; Docset fixes
  • Loading branch information...
1 parent f37fea0 commit b6624e8d413293cc3194b682e82abcf8266aa69d @gabriel committed Oct 20, 2010
Showing with 1,071 additions and 5,505 deletions.
  1. +5 −0 Classes/NSBundle+YAJL.h
  2. +11 −1 Classes/NSObject+YAJL.h
  3. +143 −0 Classes/YAJL.h
  4. +12 −0 Classes/YAJLDocument.h
  5. +14 −11 Classes/YAJLGen.h
  6. +35 −32 Classes/YAJLParser.h
  7. +1 −1 Doxyfile
  8. +125 −121 Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj
  9. +136 −93 Project/YAJL.xcodeproj/project.pbxproj
  10. +10 −0 README.md
  11. +1 −1 Scripts/iPhoneFramework.sh
  12. +3 −3 Tests/Samples/overflow_longlong.json
  13. +5 −0 Tests/Samples/overflow_longlong_macosx.json
  14. +51 −0 Tests/Samples/twitter_snowflake.json
  15. +16 −0 Tests/TwitterTest.m
  16. +8 −0 Tests/YAJLParserTest.m
  17. +3 −4 XCConfig/Shared.xcconfig
  18. 0 {yajl-1.0.9/src → yajl-1.0.11}/api/yajl_common.h
  19. +1 −1 {yajl-1.0.9/src → yajl-1.0.11}/api/yajl_gen.h
  20. +1 −1 {yajl-1.0.9/src → yajl-1.0.11}/api/yajl_parse.h
  21. +23 −0 yajl-1.0.11/api/yajl_version.h
  22. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl.c
  23. +85 −0 yajl-1.0.11/yajl/yajl_common.h
  24. +159 −0 yajl-1.0.11/yajl/yajl_gen.h
  25. +193 −0 yajl-1.0.11/yajl/yajl_parse.h
  26. +23 −0 yajl-1.0.11/yajl/yajl_version.h
  27. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_alloc.c
  28. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_alloc.h
  29. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_buf.c
  30. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_buf.h
  31. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_bytestack.h
  32. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_encode.c
  33. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_encode.h
  34. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_gen.c
  35. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_lex.c
  36. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_lex.h
  37. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_parser.c
  38. 0 {yajl-1.0.9/src → yajl-1.0.11}/yajl_parser.h
  39. +7 −0 yajl-1.0.11/yajl_version.c
  40. +0 −19 yajl-1.0.9/BUILDING
  41. +0 −12 yajl-1.0.9/BUILDING.win32
  42. +0 −83 yajl-1.0.9/CMakeLists.txt
  43. +0 −29 yajl-1.0.9/COPYING
  44. +0 −107 yajl-1.0.9/ChangeLog
  45. +0 −68 yajl-1.0.9/README
  46. +0 −9 yajl-1.0.9/TODO
  47. +0 −26 yajl-1.0.9/YAJLDoc.cmake
  48. +0 −94 yajl-1.0.9/configure
  49. +0 −55 yajl-1.0.9/reformatter/CMakeLists.txt
  50. +0 −215 yajl-1.0.9/reformatter/json_reformat.c
  51. +0 −83 yajl-1.0.9/src/CMakeLists.txt
  52. +0 −1,258 yajl-1.0.9/src/YAJL.dxy
  53. +0 −196 yajl-1.0.9/src/yajl
  54. +0 −39 yajl-1.0.9/test/CMakeLists.txt
  55. +0 −6 yajl-1.0.9/test/cases/array.json
  56. +0 −22 yajl-1.0.9/test/cases/array.json.gold
  57. +0 −1 yajl-1.0.9/test/cases/array_close.json
  58. +0 −2 yajl-1.0.9/test/cases/array_close.json.gold
  59. +0 −1 yajl-1.0.9/test/cases/array_open.json
  60. +0 −2 yajl-1.0.9/test/cases/array_open.json.gold
  61. +0 −4 yajl-1.0.9/test/cases/bogus_char.json
  62. +0 −10 yajl-1.0.9/test/cases/bogus_char.json.gold
  63. +0 −1 yajl-1.0.9/test/cases/codepoints_from_unicode_org.json
  64. +0 −2 yajl-1.0.9/test/cases/codepoints_from_unicode_org.json.gold
  65. +0 −11 yajl-1.0.9/test/cases/dc_simple_with_comments.json
  66. +0 −5 yajl-1.0.9/test/cases/dc_simple_with_comments.json.gold
  67. +0 −1 yajl-1.0.9/test/cases/deep_arrays.json
  68. +0 −2,049 yajl-1.0.9/test/cases/deep_arrays.json.gold
  69. +0 −1 yajl-1.0.9/test/cases/difficult_json_c_test_case.json
  70. +0 −36 yajl-1.0.9/test/cases/difficult_json_c_test_case.json.gold
  71. +0 −1 yajl-1.0.9/test/cases/difficult_json_c_test_case_with_comments.json
  72. +0 −36 yajl-1.0.9/test/cases/difficult_json_c_test_case_with_comments.json.gold
  73. +0 −1 yajl-1.0.9/test/cases/doubles.json
  74. +0 −7 yajl-1.0.9/test/cases/doubles.json.gold
  75. +0 −1 yajl-1.0.9/test/cases/empty_array.json
  76. +0 −3 yajl-1.0.9/test/cases/empty_array.json.gold
  77. +0 −1 yajl-1.0.9/test/cases/empty_string.json
  78. +0 −2 yajl-1.0.9/test/cases/empty_string.json.gold
  79. +0 −4 yajl-1.0.9/test/cases/escaped_bulgarian.json
  80. +0 −7 yajl-1.0.9/test/cases/escaped_bulgarian.json.gold
  81. +0 −1 yajl-1.0.9/test/cases/escaped_foobar.json
  82. +0 −2 yajl-1.0.9/test/cases/escaped_foobar.json.gold
  83. +0 −1 yajl-1.0.9/test/cases/false.json
  84. +0 −2 yajl-1.0.9/test/cases/false.json.gold
  85. +0 −1 yajl-1.0.9/test/cases/false_then_garbage.json
  86. +0 −2 yajl-1.0.9/test/cases/false_then_garbage.json.gold
  87. +0 −2 yajl-1.0.9/test/cases/four_byte_utf8.json
  88. +0 −5 yajl-1.0.9/test/cases/four_byte_utf8.json.gold
  89. +0 −3 yajl-1.0.9/test/cases/integers.json
  90. +0 −14 yajl-1.0.9/test/cases/integers.json.gold
  91. +0 −1 yajl-1.0.9/test/cases/invalid_utf8.json
  92. +0 −3 yajl-1.0.9/test/cases/invalid_utf8.json.gold
  93. +0 −1 yajl-1.0.9/test/cases/isolated_surrogate_marker.json
  94. +0 −2 yajl-1.0.9/test/cases/isolated_surrogate_marker.json.gold
  95. +0 −1 yajl-1.0.9/test/cases/leading_zero_in_number.json
  96. +0 −5 yajl-1.0.9/test/cases/leading_zero_in_number.json.gold
  97. +0 −7 yajl-1.0.9/test/cases/lonely_minus_sign.json
  98. +0 −9 yajl-1.0.9/test/cases/lonely_minus_sign.json.gold
  99. +0 −1 yajl-1.0.9/test/cases/lonely_number.json
  100. +0 −2 yajl-1.0.9/test/cases/lonely_number.json.gold
  101. +0 −1 yajl-1.0.9/test/cases/map_close.json
  102. +0 −2 yajl-1.0.9/test/cases/map_close.json.gold
  103. +0 −1 yajl-1.0.9/test/cases/map_open.json
  104. +0 −2 yajl-1.0.9/test/cases/map_open.json.gold
  105. +0 −1 yajl-1.0.9/test/cases/missing_integer_after_decimal_point.json
  106. +0 −2 yajl-1.0.9/test/cases/missing_integer_after_decimal_point.json.gold
  107. +0 −1 yajl-1.0.9/test/cases/missing_integer_after_exponent.json
  108. +0 −2 yajl-1.0.9/test/cases/missing_integer_after_exponent.json.gold
  109. +0 −1 yajl-1.0.9/test/cases/non_utf8_char_in_string.json
  110. +0 −8 yajl-1.0.9/test/cases/non_utf8_char_in_string.json.gold
  111. +0 −1 yajl-1.0.9/test/cases/null.json
  112. +0 −2 yajl-1.0.9/test/cases/null.json.gold
  113. +0 −1 yajl-1.0.9/test/cases/null_then_garbage.json
  114. +0 −2 yajl-1.0.9/test/cases/null_then_garbage.json.gold
  115. +0 −5 yajl-1.0.9/test/cases/nulls_and_bools.json
  116. +0 −9 yajl-1.0.9/test/cases/nulls_and_bools.json.gold
  117. +0 −5 yajl-1.0.9/test/cases/simple.json
  118. +0 −9 yajl-1.0.9/test/cases/simple.json.gold
  119. +0 −11 yajl-1.0.9/test/cases/simple_with_comments.json
  120. +0 −9 yajl-1.0.9/test/cases/simple_with_comments.json.gold
  121. +0 −1 yajl-1.0.9/test/cases/string_invalid_escape.json
  122. +0 −3 yajl-1.0.9/test/cases/string_invalid_escape.json.gold
  123. +0 −1 yajl-1.0.9/test/cases/string_invalid_hex_char.json
  124. +0 −2 yajl-1.0.9/test/cases/string_invalid_hex_char.json.gold
  125. +0 −3 yajl-1.0.9/test/cases/string_with_escapes.json
  126. +0 −7 yajl-1.0.9/test/cases/string_with_escapes.json.gold
  127. +0 −2 yajl-1.0.9/test/cases/string_with_invalid_newline.json
  128. +0 −2 yajl-1.0.9/test/cases/string_with_invalid_newline.json.gold
  129. +0 −1 yajl-1.0.9/test/cases/three_byte_utf8.json
  130. +0 −7 yajl-1.0.9/test/cases/three_byte_utf8.json.gold
  131. +0 −1 yajl-1.0.9/test/cases/true.json
  132. +0 −2 yajl-1.0.9/test/cases/true.json.gold
  133. +0 −1 yajl-1.0.9/test/cases/true_then_garbage.json
  134. +0 −2 yajl-1.0.9/test/cases/true_then_garbage.json.gold
  135. +0 −1 yajl-1.0.9/test/cases/unescaped_bulgarian.json
  136. +0 −4 yajl-1.0.9/test/cases/unescaped_bulgarian.json.gold
  137. +0 −65 yajl-1.0.9/test/run_tests.sh
  138. +0 −291 yajl-1.0.9/test/yajl_test.c
  139. +0 −55 yajl-1.0.9/verify/CMakeLists.txt
  140. +0 −135 yajl-1.0.9/verify/json_verify.c
View
@@ -49,6 +49,11 @@
Load JSON from bundle.
@param resource Resource name with extension, for example, file.json
@param options Parser options
+ - YAJLParserOptionsNone: No options
+ - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
+ - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
+
@param error Out error
@result JSON value (NSArray, NSDictionary) or nil if errored
*/
View
@@ -75,6 +75,11 @@
To override JSON value to encode (or support custom objects), implement (id)JSON; See YAJLCoding in YAJLGen.h
@throws YAJLGenInvalidObjectException If object is invalid
@param options
+ - YAJLGenOptionsNone: No options
+ - YAJLGenOptionsBeautify: Beautifiy JSON output
+ - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value)
+ - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL)
+
@param indentString
@result JSON String
*/
@@ -125,7 +130,12 @@
If an error occurs, the returned object will be the current state of the object when
the error occurred.
- @param options Options (see YAJLParserOptions)
+ @param options Parse options
+ - YAJLParserOptionsNone: No options
+ - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
+ - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
+
@param error Error to set if we failed to parse
@result JSON object
@throws YAJLParserException If a parse error occured
View
@@ -32,3 +32,146 @@
#import "YAJLGen.h"
#import "NSObject+YAJL.h"
#import "NSBundle+YAJL.h"
+
+/*!
+ @mainpage YAJL
+
+ The YAJL framework is an Objective-C wrapper around the http://lloyd.github.com/yajl/ SAX-style JSON parser.
+
+ @section Usage Usage
+
+ To parse JSON from an NSData (or NSString):
+
+ @code
+ NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"];
+ NSArray *arrayFromData = [JSONData yajl_JSON];
+
+ NSString *JSONString = @"[\"Test\"]";
+ NSArray *arrayFromString = [JSONString yajl_JSON];
+
+ // With options and out error
+ NSError *error = nil;
+ NSArray *arrayFromString = [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error];
+ @endcode
+
+ To generate JSON from an object:
+
+ @code
+ NSDictionary *dict = [NSDictionary dictionaryWithObject:@"value" forKey:@"key"];
+ NSString *JSONString = [dict yajl_JSONString];
+
+ // Beautified with custon indent string
+ NSArray *array = [NSArray arrayWithObjects:@"value1", @"value2", nil];
+ NSString *JSONString = [dict yajl_JSONStringWithOptions:YAJLGenOptionsBeautify indentString:@" "];
+
+ To use the streaming (or SAX style) parser, use YAJLParser. For higher level (document) streaming, see below.
+
+ NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
+
+ YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments];
+ parser.delegate = self;
+ [parser parse:data];
+ if (parser.parserError) {
+ NSLog(@"Error:\n%@", parser.parserError);
+ }
+
+ parser.delegate = nil;
+ [parser release];
+
+ // Include delegate methods from YAJLParserDelegate
+ - (void)parserDidStartDictionary:(YAJLParser *)parser;
+ - (void)parserDidEndDictionary:(YAJLParser *)parser;
+
+ - (void)parserDidStartArray:(YAJLParser *)parser;
+ - (void)parserDidEndArray:(YAJLParser *)parser;
+
+ - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key;
+ - (void)parser:(YAJLParser *)parser didAdd:(id)value;
+ @endcode
+
+ @subsection ParserOptions Parser Options
+
+ There are options when parsing that can be specified with YAJLParser#initWithParserOptions:.
+
+ - YAJLParserOptionsAllowComments: Allows comments in JSON
+ - YAJLParserOptionsCheckUTF8: Will verify UTF-8
+ - YAJLParserOptionsStrictPrecision: Will force strict precision and return integer overflow error, if number is greater than long long.
+
+ @subsection StreamingExample Streaming Example (Parser)
+
+ @code
+ YAJLParser *parser = [[[YAJLParser alloc] init] autorelease];
+ parser.delegate = self;
+
+ // A chunk of data comes...
+ YAJLParserStatus status = [parser parse:chunk1];
+ // 'status' should be YAJLParserStatusInsufficientData, if its not finished
+ if (parser.parserError) ...;
+
+ // Another chunk of data comes...
+ YAJLParserStatus status = [parser parse:chunk2];
+ // 'status' should be YAJLParserStatusOK if its finished
+ if (parser.parserError) ...;
+ @encode
+
+ @subsection UsageDocument Usage (Document-style)
+
+ To use the document style, use YAJLDocument. Usage should be very similar to NSXMLDocument.
+
+ @code
+ NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
+ NSError *error = nil;
+ YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error];
+ // Access root element at document.root
+ NSLog(@"Root: %@", document.root);
+ [document release];
+ @endcode
+
+ @subsection StreamingExampleDocument Streaming Example (Document)
+
+ @code
+ YAJLDocument *document = [[YAJLDocument alloc] init];
+ document.delegate = self;
+
+ NSError *error = nil;
+ [document parse:chunk1 error:error];
+ [document parse:chunk2 error:error];
+
+ // You can access root element at document.root
+ NSLog(@"Root: %@", document.root);
+ [document release];
+
+ // Or via the YAJLDocumentDelegate delegate methods
+
+ - (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { }
+ - (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { }
+ - (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { }
+ - (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { }
+ @endcode
+
+ @section LoadJSONBundle Load JSON from Bundle
+
+ @code
+ id JSONValue = [[NSBundle mainBundle] yajl_JSONFromResource:@"kegs.json"];
+ @endcode
+
+ @section CustomizedEncoding Customized Encoding
+
+ To implement JSON encodable value for custom objects or override for existing objects, implement <tt>- (id)JSON;</tt>
+
+ For example:
+
+ @code
+ @interface CustomObject : NSObject
+ @end
+
+ @implementation CustomObject
+
+ - (id)JSON {
+ return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]];
+ }
+
+ @end
+ @endcode
+
+ */
View
@@ -139,13 +139,21 @@ extern NSInteger YAJLDocumentStackCapacity;
Create document from data.
@param data Data to parse
@param parserOptions Parse options
+ - YAJLParserOptionsNone: No options
+ - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
+ - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
@param error Error to set on failure
*/
- (id)initWithData:(NSData *)data parserOptions:(YAJLParserOptions)parserOptions error:(NSError **)error;
/*!
Create empty document with parser options.
@param parserOptions Parse options
+ - YAJLParserOptionsNone: No options
+ - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
+ - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
*/
- (id)initWithParserOptions:(YAJLParserOptions)parserOptions;
@@ -154,6 +162,10 @@ extern NSInteger YAJLDocumentStackCapacity;
@param data Data to parse
@param error Out error to set on failure
@result Parser status
+ - YAJLParserStatusNone: No status
+ - YAJLParserStatusOK: Parsed OK
+ - YAJLParserStatusInsufficientData: There was insufficient data
+ - YAJLParserStatusError: Parser errored
*/
- (YAJLParserStatus)parse:(NSData *)data error:(NSError **)error;
View
@@ -29,19 +29,17 @@
#include "yajl_gen.h"
-//! Exception type if we encounter invalid object
-extern NSString *const YAJLGenInvalidObjectException;
-/*!
- JSON generate options.
- */
-enum {
- YAJLGenOptionsNone = 0, /**< No options */
- YAJLGenOptionsBeautify = 1 << 0, /**< Beautifiy JSON output */
- YAJLGenOptionsIgnoreUnknownTypes = 1 << 1, /**< Ignore unknown types (will use null value) */
- YAJLGenOptionsIncludeUnsupportedTypes = 1 << 2, /**< Handle non-JSON types (including NSDate, NSData, NSURL) */
+extern NSString *const YAJLGenInvalidObjectException; //! Exception type if we encounter invalid object
+
+//! JSON generate options
+enum YAJLGenOptions {
+ YAJLGenOptionsNone = 0, //!< No options
+ YAJLGenOptionsBeautify = 1 << 0, //!< Beautifiy JSON output
+ YAJLGenOptionsIgnoreUnknownTypes = 1 << 1, //!< Ignore unknown types (will use null value)
+ YAJLGenOptionsIncludeUnsupportedTypes = 1 << 2, //!< Handle non-JSON types (including NSDate, NSData, NSURL)
};
-typedef NSUInteger YAJLGenOptions; /**< JSON generate options */
+typedef NSUInteger YAJLGenOptions;
/*!
YAJL JSON string generator.
@@ -67,6 +65,11 @@ typedef NSUInteger YAJLGenOptions; /**< JSON generate options */
/*!
JSON generator with options.
@param genOptions Generate options
+ - YAJLGenOptionsNone: No options
+ - YAJLGenOptionsBeautify: Beautifiy JSON output
+ - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value)
+ - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL)
+
@param indentString String for indentation
*/
- (id)initWithGenOptions:(YAJLGenOptions)genOptions indentString:(NSString *)indentString;
View
@@ -31,42 +31,37 @@
#include "yajl_parse.h"
-extern NSString *const YAJLErrorDomain;
-extern NSString *const YAJLParserException;
-extern NSString *const YAJLParsingUnsupportedException;
+extern NSString *const YAJLErrorDomain; //! Error domain for YAJL
+extern NSString *const YAJLParserException; //! Generic parse exception
+extern NSString *const YAJLParsingUnsupportedException; //! Parsing unsupported exception
-extern NSString *const YAJLParserValueKey; // Key in NSError userInfo for value we errored on
+extern NSString *const YAJLParserValueKey; //! Key in NSError userInfo for value we errored on
-#ifdef DEBUG
-#define YAJLDebug(...) NSLog(__VA_ARGS__)
-#else
-#define YAJLDebug(...) do {} while(0)
-#endif
-
-typedef enum {
- YAJLParserErrorCodeAllocError = -1000,
- YAJLParserErrorCodeDoubleOverflow = -1001,
- YAJLParserErrorCodeIntegerOverflow = -1002
-} YAJLParserErrorCode;
-
-enum {
- YAJLParserOptionsNone = 0,
- YAJLParserOptionsAllowComments = 1 << 0, /**< Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //) */
- YAJLParserOptionsCheckUTF8 = 1 << 1, /**< Invalid UTF8 strings will cause a parse error */
- YAJLParserOptionsStrictPrecision = 1 << 2, /**< If YES will force strict precision and return integer overflow error */
+//! Parser error codes
+enum YAJLParserErrorCode {
+ YAJLParserErrorCodeAllocError = -1000, //!< Alloc error
+ YAJLParserErrorCodeDoubleOverflow = -1001, //!< Double overflow
+ YAJLParserErrorCodeIntegerOverflow = -1002 //!< Integer overflow
};
-typedef NSUInteger YAJLParserOptions; /*!< Parser options */
+typedef NSInteger YAJLParserErrorCode; //! Parser error codes
+
+//! Parser options
+enum YAJLParserOptions {
+ YAJLParserOptionsNone = 0, //!< No options
+ YAJLParserOptionsAllowComments = 1 << 0, //!< Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ YAJLParserOptionsCheckUTF8 = 1 << 1, //!< Invalid UTF8 strings will cause a parse error
+ YAJLParserOptionsStrictPrecision = 1 << 2, //!< If YES will force strict precision and return integer overflow error
+};
+typedef NSUInteger YAJLParserOptions; //! Parser options
-/*!
- Parser status.
- */
+//! Parser status
enum {
- YAJLParserStatusNone = 0,
- YAJLParserStatusOK = 1, /*!< Parsed OK */
- YAJLParserStatusInsufficientData = 2, /*!< There was insufficient data */
- YAJLParserStatusError = 3 /*!< Parser errored */
+ YAJLParserStatusNone = 0, //!< No status
+ YAJLParserStatusOK = 1, //!< Parsed OK
+ YAJLParserStatusInsufficientData = 2, //!< There was insufficient data
+ YAJLParserStatusError = 3 //!< Parser errored
};
-typedef NSUInteger YAJLParserStatus; /*!< Status of the last parse */
+typedef NSUInteger YAJLParserStatus; //!< Status of the last parse event
@class YAJLParser;
@@ -160,7 +155,11 @@ typedef NSUInteger YAJLParserStatus; /*!< Status of the last parse */
/*!
Create parser with data and options.
- @param parserOptions
+ @param parserOptions Parser options
+ - YAJLParserOptionsNone: No options
+ - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
+ - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
+ - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
*/
- (id)initWithParserOptions:(YAJLParserOptions)parserOptions;
@@ -171,7 +170,11 @@ typedef NSUInteger YAJLParserStatus; /*!< Status of the last parse */
previous calls return YAJLParserStatusInsufficientData.
@param data
- @result See YAJLParserStatus
+ @result Parser status
+ - YAJLParserStatusNone: No status
+ - YAJLParserStatusOK: Parsed OK
+ - YAJLParserStatusInsufficientData: There was insufficient data
+ - YAJLParserStatusError: Parser errored
*/
- (YAJLParserStatus)parse:(NSData *)data;
View
@@ -31,7 +31,7 @@ PROJECT_NAME = YAJL
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 0.2.23
+PROJECT_NUMBER = 0.2.24
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Oops, something went wrong.

0 comments on commit b6624e8

Please sign in to comment.