JubeatPlus 3.9.11
Loading...
Searching...
No Matches
CJSONSerializer Class Reference

Turns Foundation objects into JSON data. More...

#include <CJSONSerializer.h>

Inheritance diagram for CJSONSerializer:
Collaboration diagram for CJSONSerializer:

Instance Methods

(BOOL) - isValidJSONObject:
 Whether an object is one the serialiser can turn into JSON.
(nullable NSData *) - serializeObject:error:
 Serialises any supported object to JSON data, dispatching on its class.
(nullable NSData *) - serializeNull:error:
 Serialises a null to the shared "null" token data.
(nullable NSData *) - serializeNumber:error:
 Serialises a number: a boolean to the shared "true"/"false" token data, otherwise its string value as UTF-8.
(nullable NSData *) - serializeString:error:
 Serialises a string as a quoted, escaped JSON string.
(nullable NSData *) - serializeArray:error:
 Serialises an array as a JSON array.
(nullable NSData *) - serializeDictionary:error:
 Serialises a dictionary as a JSON object.

Class Methods

(instancetype) + serializer
 Vends a fresh serialiser instance.

Properties

NSUInteger options
 Serialisation options.

Detailed Description

Turns Foundation objects into JSON data.

Method Documentation

◆ isValidJSONObject:

- (BOOL) isValidJSONObject: (nullable id) object

Whether an object is one the serialiser can turn into JSON.

Parameters
objectThe object to test.
Returns
YES for NSNull , NSNumber , NSString , NSArray , NSDictionary , NSData , or any object answering -JSONDataRepresentation .
Ghidra address:
0x66af4

◆ serializeArray:error:

- (nullable NSData *) serializeArray: (nullable NSArray *) array
error: (NSError *_Nullable *_Nullable) error 

Serialises an array as a JSON array.

Parameters
arrayThe array to serialise.
errorOn failure, the reason; may be nullptr .
Returns
The serialised array, or nil on failure.
Ghidra address:
0x6743c

◆ serializeDictionary:error:

- (nullable NSData *) serializeDictionary: (nullable NSDictionary *) dictionary
error: (NSError *_Nullable *_Nullable) error 

Serialises a dictionary as a JSON object.

Parameters
dictionaryThe dictionary to serialise.
errorOn failure, the reason; may be nullptr .
Returns
The serialised object, or nil on failure.
Ghidra address:
0x67608

◆ serializeNull:error:

- (nullable NSData *) serializeNull: (nullable NSNull *) null
error: (NSError *_Nullable *_Nullable) error 

Serialises a null to the shared "null" token data.

Parameters
nullThe null to serialise.
errorOn failure, the reason; may be nullptr .
Returns
The "null" token data, or nil on failure.
Ghidra address:
0x67118

◆ serializeNumber:error:

- (nullable NSData *) serializeNumber: (nullable NSNumber *) number
error: (NSError *_Nullable *_Nullable) error 

Serialises a number: a boolean to the shared "true"/"false" token data, otherwise its string value as UTF-8.

Parameters
numberThe number to serialise.
errorOn failure, the reason; may be nullptr .
Returns
The serialised number, or nil on failure.
Ghidra address:
0x67124

◆ serializeObject:error:

- (nullable NSData *) serializeObject: (nullable id) object
error: (NSError *_Nullable *_Nullable) error 

Serialises any supported object to JSON data, dispatching on its class.

Parameters
objectThe object to serialise.
errorOut: the failure reason when serialisation fails.
Returns
The JSON data, or nil on failure.
Ghidra address:
0x66c60

◆ serializer

+ (instancetype) serializer

Vends a fresh serialiser instance.

Returns
A new CJSONSerializer .
Ghidra address:
0x66acc
Ghidra address:
0x66acc

◆ serializeString:error:

- (nullable NSData *) serializeString: (nullable NSString *) string
error: (NSError *_Nullable *_Nullable) error 

Serialises a string as a quoted, escaped JSON string.

Parameters
stringThe string to serialise.
errorOn failure, the reason; may be nullptr .
Returns
The quoted, escaped string, or nil on failure.
Ghidra address:
0x67220

Property Documentation

◆ options

- (NSUInteger) options
readwritenonatomicassign

Serialisation options.

A set low bit makes -serializeString:error: escape the forward slash.


The documentation for this class was generated from the following files: