class   SerializationContext

Context for serializing ron elements. Custom overrides for Ron are stored in the local or global serialization context.

parentContext:

SerializationContext  (SerializationContext? parentContext = null)

Context for serializing ron elements. Custom overrides for Ron are stored in the local or global serialization context.

parentContext:

HashSet<Type> RonTypes

Set of types recognized by this serialization context.

Dictionary<Type Type> proxyTypes

Proxy types recognized by this serialization context.

SerializationContext   parentContext

The parent serializtion context to inherit.

SerializationResult<object> DeserializeElement (RonElement? element,Type? typeHint,string path)

Deserialize a ron element

element:
typeHint:
path:
returns:
throw:

SerializationResult<object> DeserializeUnitClass (Type typeHint,RonUnitStruct unitStruct)

Deserialize Unit Tuple

typeHint:
unitStruct:
returns:

SerializationResult<object> DeserializeEnum (Type enumType,RonElement identifier)

Deserialize Enum

enumType:
identifier:
returns:

SerializationResult<object> DeserializeNamedValueClass (Type? typeHint,RonNamedValueStruct element,string path)

Deserialize name value struct

typeHint:
element:
path:
returns:

SerializationResult<object> DeserializeClassField (RonElement element,object instance,string path)

Deserialize named field.

element:
instance:
path:
returns:

SerializationResult<object> DeserializeTupleStructClass (Type? typeHint,RonTupleStruct element,string path)

Deserialize Tuple struct

typeHint:
element:
path:
returns:

SerializationResult<object> DeserializeTupleClassBody (Type typeHint,RonTuple body,string path)

Deserialize ron tuple class body.

typeHint:
body:
path:
returns:

SerializationResult<object> DeserializeList (Type? typeHint,RonList list,string path)

Deserialize list

typeHint:
list:
path:
returns:

SerializationResult<object> DeserializeMap (RonMap map,Type? typeHint,string path)

Deserialize map

map:
typeHint:
path:
returns:
throw:

Type   GetTypeFromName  (string? name,Type? backupType)

Get a type from it's name.

name:
backupType:
returns:
throw:

Type   GetIntermediateType  (Type? targetType)

Get intermediate deserialization type, such as for a proxy.

targetType:
returns:

Type   InferType  (RonElement? element)

Infer the type of the AST element. If the type cannot be inferred then return null.

element:
returns:
throw:

Type   GetMapIntermediateType  (Type? type)

Get the value type for deserializing a ron map.

type:
returns:

object   ConvertType  (object? source,Type? targetType)

Convert type from the source to the targetType.

source:
targetType:
returns:

static   SerializationContext   CreateGlobalContext()

Create global serialization context.

returns:

static   Dictionary<Type TypeSerializerConverter> converterCache

Memoized converters to use.

RonElement   ToAST  (object? source,Type? fieldType = null)

Convert the object to a Ron AST. If field type is provided it will allow for inference for the element.

source:
fieldType:
returns:

static   RonInteger   CreateIntValue  (object source,IntegerSuffix? suffix)

Create a Ron integer element.

source:
suffix:
returns:

static   RonFloat   CreateFloatValue  (object source,FloatSuffix? suffix)

Create a Ron float element.

source:
suffix:
returns:

static   string   ShortestRound  (object source)

Determine the shortest round trippable string.

source:
returns:

void   RegisterType  (Type type)

Register a new known type

type:

void   RegisterTypeConverter  (Type type,TypeSerializerConverter converter)

Register a custom type converter for the type.

type:
converter:

void   RegisterListType  (Type type)

Register type to be serialized as a list.

type:

void   RegisterMapType  (Type type)

Register type to be serialized as a map.

type:

void   RegisterTupleConverter<T> (Func<T object[]> converter)

Register converter to serialize a type as a tuple.

T
converter:

void   RegisterProxyType  (Type sourceType,Type proxyType)

Register a custom proxy for the source type.

sourceType:
proxyType: