Extends capabilities of JsonUtility by adding type annotations to the serialized JSON, Unity object reference handling and integer enquotement. More...
Public Member Functions | |
delegate string | InstanceIDHandlerDelegate (object context, int value) |
JsonUtilityExtensions.ToJsonWithTypeAnnotation(object,Quantum.JsonUtilityExtensions.InstanceIDHandlerDelegate) | |
delegate Type | TypeResolverDelegate (string typeName) |
JsonUtilityExtensions.FromJsonWithTypeAnnotation | |
delegate string | TypeSerializerDelegate (Type type) |
JsonUtilityExtensions.ToJsonWithTypeAnnotation(object,Quantum.JsonUtilityExtensions.InstanceIDHandlerDelegate) | |
Static Public Member Functions | |
static string | EnquoteIntegers (string json, int minDigits=8) |
Enquotes integers in the JSON string that are at least minDigits long. This is useful for parsers that interpret large integers as floating point numbers. More... | |
static object | FromJsonWithTypeAnnotation (string json, TypeResolverDelegate typeResolver=null) |
Converts JSON with type annotation. If there are no type annotations, use typeResolver to return the expected type. More... | |
static T | FromJsonWithTypeAnnotation< T > (string json, TypeResolverDelegate typeResolver=null) |
Converts JSON with type annotation to an instance of T . If the JSON contains type annotations, they need to match the expected result type. If there are no type annotations, use typeResolver to return the expected type. More... | |
static string | ToJsonWithTypeAnnotation (object obj, InstanceIDHandlerDelegate instanceIDHandler=null) |
Converts the object to JSON with type annotations. More... | |
static void | ToJsonWithTypeAnnotation (object obj, TextWriter writer, int? integerEnquoteMinDigits=null, TypeSerializerDelegate typeSerializer=null, InstanceIDHandlerDelegate instanceIDHandler=null) |
Converts the object/IList to JSON with type annotations. More... | |
Extends capabilities of JsonUtility by adding type annotations to the serialized JSON, Unity object reference handling and integer enquotement.
|
inlinestatic |
Enquotes integers in the JSON string that are at least minDigits long. This is useful for parsers that interpret large integers as floating point numbers.
json | JSON to process |
minDigits | Digit threshold to perfom the enquoting |
|
inlinestatic |
Converts the object to JSON with type annotations.
obj | Object to be serialized. |
instanceIDHandler | Handler for UnityEngine.Object references. If the handler returns an empty string, the reference is removed from the final result. |
|
inlinestatic |
Converts the object/IList to JSON with type annotations.
obj | Object to be serialized. |
writer | The output TextWriter. |
integerEnquoteMinDigits | EnquoteIntegers |
typeSerializer | Handler for obtaining serialized type names. If null , the short assembly qualified name (namespace + name + assembly name) will be used. |
instanceIDHandler | Handler for UnityEngine.Object references. If the handler returns an empty string, the reference is removed from the final result. |
|
inlinestatic |
Converts JSON with type annotation to an instance of T . If the JSON contains type annotations, they need to match the expected result type. If there are no type annotations, use typeResolver to return the expected type.
json | JSON to be parsed |
typeResolver | Converts type name to a type instance. |
|
inlinestatic |
Converts JSON with type annotation. If there are no type annotations, use typeResolver to return the expected type.
json | JSON to be parsed |
typeResolver | Converts type name to a type instance. |