Turns Foundation objects into JSON data.
More...
#include <CJSONSerializer.h>
|
| (instancetype) | + serializer |
| | Vends a fresh serialiser instance.
|
|
| NSUInteger | options |
| | Serialisation options.
|
Turns Foundation objects into JSON data.
◆ isValidJSONObject:
| - (BOOL) isValidJSONObject: |
|
(nullable id) | object |
|
Whether an object is one the serialiser can turn into JSON.
- Parameters
-
| object | The 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
-
| array | The array to serialise. |
| error | On 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
-
| dictionary | The dictionary to serialise. |
| error | On 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
-
| null | The null to serialise. |
| error | On 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
-
| number | The number to serialise. |
| error | On 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
-
| object | The object to serialise. |
| error | Out: 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
-
| string | The string to serialise. |
| error | On failure, the reason; may be nullptr . |
- Returns
- The quoted, escaped string, or nil on failure.
- Ghidra address:
- 0x67220
◆ options
Serialisation options.
A set low bit makes -serializeString:error: escape the forward slash.
The documentation for this class was generated from the following files: