Public Member Functions | Protected Attributes

YAJLGen Class Reference

YAJL JSON string generator. More...

#import <YAJLGen.h>

List of all members.

Public Member Functions

(id) - initWithGenOptions:indentString:
 JSON generator with options.
(void) - object:
 Write JSON for object to buffer.
(void) - null
 Write null value to buffer.
(void) - bool:
 Write bool value to buffer.
(void) - number:
 Write numeric value to buffer.
(void) - string:
 Write string value to buffer.
(void) - startDictionary
 Write dictionary start ('{') to buffer.
(void) - endDictionary
 Write dictionary end ('}') to buffer.
(void) - startArray
 Write array start ('[') to buffer.
(void) - endArray
 Write array end (']') to buffer.
(void) - clear
 Clear JSON buffer.
(NSString *) - buffer
 Get current JSON buffer.

Protected Attributes

yajl_gen gen_
YAJLGenOptions genOptions_

Detailed Description

YAJL JSON string generator.

Supports the following types:

We also support the following types (if using YAJLGenOptionsIncludeUnsupportedTypes option), by converting to JSON supported types:


Member Function Documentation

- (void) bool: (BOOL)  b  

Write bool value to buffer.

Parameters:
b Output true or false
- (id) initWithGenOptions: (YAJLGenOptions)  genOptions
indentString: (NSString *)  indentString 

JSON generator with options.

Parameters:
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)
indentString String for indentation
- (void) number: (NSNumber *)  number  

Write numeric value to buffer.

Parameters:
number Numeric value
- (void) object: (id)  obj  

Write JSON for object to buffer.

Parameters:
obj Supported or custom object
- (void) string: (NSString *)  s  

Write string value to buffer.

Parameters:
s String value

The documentation for this class was generated from the following files:
 All Classes Functions Properties