Deserialization

The following program example demonstrates how contexts can be deserialized from a file upon program startup.

Set Up File

This code example requires built-in file loading functionality from the File IO namespace and built-in serialization functionality from the Serialization namespace. As such, the file housing all subsequent code is defined as using those namespaces through a meta declaration.

Deserialization Example: 
    using File IO,
    using Serialization.

Constructs Provided through the Usings

File To Read

This is a context alias for a string, essentially enabling a string to be identified differently to initiate a different set of operations than it might have otherwise. There is a mapping defined to convert this string to Formatted Serialized Text.

File Text

This is a context representing the text read from or written to a file.

Formatted Serialized Text

This is a context wrapping a dictionary of strings mapped to their own Formatted Serialized Texts. This data structure provides an infinitely nestable format for serialized data.

Example Code

`Declare the relevant contexts.`

Serialized Contexts: context Formatted Serialized Text.

Last updated