• Introduction
  • C# API
  • GraphQL API
  • Home
  • Blog
  • Docs
  • GitHub
  • Snowflake.Configuration.Serialization.Serializers
  • ConfigurationSerializer<T>
Show / Hide Table of Contents
  • Snowflake.Configuration
    • ConfigurationCollection<T>
    • ConfigurationCollectionDescriptor<T>
    • ConfigurationOptionDescriptor
    • ConfigurationOptionType
    • ConfigurationSection<T>
    • ConfigurationSectionDescriptor<T>
    • ConfigurationValueCollection
    • IConfigurationCollection
    • IConfigurationCollection<T>
    • IConfigurationCollectionDescriptor
    • IConfigurationOptionDescriptor
    • IConfigurationProperty
    • IConfigurationSection
    • IConfigurationSection<T>
    • IConfigurationSectionDescriptor
    • IConfigurationTypeMapper
    • IConfigurationValue
    • IConfigurationValueCollection
    • ISelectionOptionDescriptor
    • PathType
    • SelectionOptionDescriptor
  • Snowflake.Configuration.Attributes
    • ConfigurationOptionAttribute
    • ConfigurationSectionAttribute
    • ConfigurationTargetAttribute
    • ConfigurationTargetMemberAttribute
    • CustomMetadataAttribute
    • InputTemplateAttribute
    • SelectionOptionAttribute
  • Snowflake.Configuration.Input
    • DictionaryInputMapping
    • IDeviceInputMapping
    • IInputOption
    • IInputSerializer
    • IInputTemplate
    • IInputTemplate<T>
    • InputConfigurationSection<T>
    • InputOption
    • InputOptionAttribute
    • InputTemplate<T>
  • Snowflake.Configuration.Interceptors
    • ConfigurationInterceptor
  • Snowflake.Configuration.Serialization
    • AbstractConfigurationNode<T>
    • BooleanConfigurationNode
    • ConfigurationTarget
    • ConfigurationTraversalContext
    • DecimalConfigurationNode
    • DeviceCapabilityElementConfigurationNode
    • EnumConfigurationNode
    • IAbstractConfigurationNode
    • IAbstractConfigurationNode<T>
    • IConfigurationSerializationContext<T>
    • IConfigurationTarget
    • IConfigurationTransformer<TOutput>
    • IConfigurationTraversalContext
    • IntegralConfigurationNode
    • ListConfigurationNode
    • StringConfigurationNode
    • UnknownConfigurationNode
  • Snowflake.Configuration.Serialization.Serializers
    • AbstractStringConfigurationSerializer
    • ConfigurationSerializer<T>
    • StringSerializationContext
    • StringSerializationContextExtensions
  • Snowflake.Configuration.Serialization.Serializers.Implementations
    • SimpleCfgConfigurationSerializer
    • SimpleIniConfigurationSerializer
    • SimpleJsonConfigurationSerializer
    • SimpleXmlConfigurationSerializer
  • Snowflake.Extensibility
    • IEmptyPluginConfiguration
    • ILogger
    • IPlugin
    • IPluginCollection<T>
    • LogLevel
    • PluginAttribute
    • PluginCollection<T>
    • PluginInfoFields
  • Snowflake.Extensibility.Configuration
    • IPluginConfigurationStore
  • Snowflake.Extensibility.Provisioning
    • IPluginProperties
    • IPluginProvision
    • IProvisionedPlugin
    • PluginProvision
    • ProvisionedPlugin
  • Snowflake.Extensibility.Provisioning.Standalone
    • StandalonePlugin
    • StandalonePluginProvision
  • Snowflake.Extensibility.Queueing
    • IAsyncJobQueue
    • IAsyncJobQueue<T>
    • IAsyncJobQueue<TAsyncEnumerable, T>
    • IAsyncJobQueueFactory
  • Snowflake.Filesystem
    • DirectoryExtensions
    • FileExtensions
    • IDirectory
    • IFile
    • IIndelibleDirectory
    • IReadOnlyDirectory
    • IReadOnlyFile
  • Snowflake.Input.Controller
    • ControllerElement
    • ControllerElementCollection
    • ControllerElementExtensions
    • ControllerElementInfo
    • ControllerElementType
    • ControllerElementTypeExtensions
    • ControllerId
    • IControllerElementCollection
    • IControllerElementInfo
    • IControllerLayout
    • InvalidControllerIdException
  • Snowflake.Input.Controller.Mapped
    • ControllerElementMapping
    • ControllerElementMappingProfile
    • IControllerElementMappingProfile
    • IControllerElementMappingProfileStore
  • Snowflake.Input.Device
    • DefaultDeviceCapabilityLabels
    • DeviceCapability
    • DeviceCapabilityClass
    • DeviceCapabilityClasses
    • DeviceCapabilityExtensions
    • DeviceLayoutMapping
    • DictionaryDeviceCapabilityLabels
    • DirectInputDeviceInstance
    • IDeviceCapabilityLabels
    • IDeviceLayoutMapping
    • IInputDevice
    • IInputDeviceInstance
    • InputDriver
    • KeyboardDeviceInstance
    • PassthroughDeviceInstance
    • XInputDeviceInstance
  • Snowflake.Installation
    • AsyncInstallTask<T>
    • AsyncInstallTaskEnumerable<T>
    • ITaskResult
    • TaskResult
    • TaskResult<T>
  • Snowflake.Installation.Extensibility
    • GameInstaller
    • IGameInstaller
    • IInstallable
    • Installable
    • SupportedPlatformAttribute
  • Snowflake.Installation.Tasks
    • CopyDirectoryContentsTask
    • CopyFileTask
    • ExecuteAsyncTask<TResult>
    • ExtractZipTask
    • FailureTask<T>
  • Snowflake.Loader
    • IComposable
    • IModule
    • IModuleEnumerator
    • IModuleLoader<T>
    • ImportServiceAttribute
    • IServiceRepository
    • Module
  • Snowflake.Model.Database.Exceptions
    • DependentEntityNotExistsException
    • EntityAlreadyExistsException
  • Snowflake.Model.Database.Migrations
    • Empty
    • InitialCreate
  • Snowflake.Model.Game
    • Game
    • IGame
    • IGameExtension
    • IGameLibrary
    • IPlatformInfo
    • ISystemFile
    • PlatformId
  • Snowflake.Model.Game.LibraryExtensions
    • GameConfigurationExtensionExtensions
    • GameFileExtensionExtensions
    • IGameConfigurationExtension
    • IGameConfigurationExtensionProvider
    • IGameExtensionProvider
    • IGameExtensionProvider<TExtension>
    • IGameFileExtension
    • IGameFileExtensionProvider
  • Snowflake.Model.Records
    • FileRecord
    • GameRecord
    • IMetadataCollection
    • IRecord
    • IRecordMetadata
    • IRecordMetadataQuery
    • MetadataCollection
    • RecordMetadata
  • Snowflake.Model.Records.File
    • FileMetadataKeys
    • IFileRecord
    • ImageMetadataKeys
    • ImageTypes
  • Snowflake.Model.Records.Game
    • GameMetadataKeys
    • IGameRecord
    • IGameRecordQuery
  • Snowflake.Orchestration.Extensibility
    • EmulatedController
    • EmulatedPortsManager
    • EmulatorCompatibility
    • EmulatorOrchestrator
    • GameEmulation
    • GameEmulation<TConfigurationCollection>
    • GameEmulationState
    • IEmulatedController
    • IEmulatedPortDeviceEntry
    • IEmulatedPortsManager
    • IEmulatedPortStore
    • IEmulatorOrchestrator
    • IGameEmulation
  • Snowflake.Orchestration.Extensibility.Extensions
    • DeviceEnumeratorExtensions
  • Snowflake.Orchestration.Process
    • IEmulatorExecutable
    • IEmulatorExecutableProvider
    • IProcessBuilder
    • ProcessExtensions
  • Snowflake.Orchestration.Saving
    • GameFileExtensionGameSaveManagerExtensions
    • IGameSaveManager
    • ISaveGame
    • ISaveProfile
    • SaveGame
    • SaveManagementStrategy
  • Snowflake.Orchestration.SystemFiles
    • ISystemFileProvider
  • Snowflake.Persistence
    • ISqlDatabase
    • SqliteDatabase
    • SqliteMemoryDatabase
  • Snowflake.Remoting.Electron
    • IElectronPackage
    • IElectronPackageProvider
  • Snowflake.Remoting.Kestrel
    • IKestrelServerMiddlewareProvider
    • IKestrelWebServerService
  • Snowflake.Romfile
    • IFileSignature
    • IRomFileInfo
    • IStructuredFilename
    • NamingConvention
    • RomFileInfo
    • StructuredFilename
  • Snowflake.Romfile.Extensions
    • StringExtensions
  • Snowflake.Romfile.Tokenizer
    • FieldType
    • GoodToolsTokenClassifier
    • NoIntroTokenClassifier
    • StructuredFilenameToken
  • Snowflake.Scraping
    • GameScrapeContext
    • IScrapeContext
    • ISeed
    • ISeedRootContext
    • Seed
    • SeedContent
    • SeedRootContext
  • Snowflake.Scraping.Extensibility
    • AttachTarget
    • Culler
    • Directive
    • DirectiveAttribute
    • FileInstallationTraverserBase
    • GameMetadataTraverserBase
    • ICuller
    • IFileInstallationTraverser
    • IGameMetadataTraverser
    • IScraper
    • IScraperDirective
    • ITraverser<TProducts, TEffectTarget>
    • Scraper
    • SeedBuilder
    • SeedTree
    • Traverser<TProducts, TEffectTarget>
  • Snowflake.Services
    • IContentDirectoryProvider
    • IDeviceEnumerator
    • ILogProvider
    • IPluginManager
    • IServiceEnumerator
    • IServiceRegistrationProvider
    • IStoneProvider
  • Snowflake.Shiragame
    • IRomInfo
    • ISerialInfo
    • IShiragameProvider
    • RomInfo
    • SerialInfo

Class ConfigurationSerializer<T>

Implements IConfigurationTransformer<TOutput> by serializing the syntax tree into some string or binary format.

Inheritance
System.Object
ConfigurationSerializer<T>
AbstractStringConfigurationSerializer
Implements
IConfigurationTransformer<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Snowflake.Configuration.Serialization.Serializers
Assembly: Snowflake.Framework.dll
Syntax
public abstract class ConfigurationSerializer<T> : IConfigurationTransformer<T>
Type Parameters
Name Description
T

The type of the serialized data after traversing the tree.

Methods

SerializeBlockBegin(IConfigurationSerializationContext<T>, Int32)

Serialize a marker or header where a block or section begins in the serialized stream.

Declaration
public abstract void SerializeBlockBegin(IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeBlockEnd(IConfigurationSerializationContext<T>, Int32)

Serialize a marker or footer where a block or section ends in the serialized stream.

Declaration
public abstract void SerializeBlockEnd(IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeFooter(IConfigurationSerializationContext<T>)

Write the header to the serialized stream.

Declaration
public virtual void SerializeFooter(IConfigurationSerializationContext<T> context)
Parameters
Type Name Description
IConfigurationSerializationContext<T> context

The serialization context.

SerializeHeader(IConfigurationSerializationContext<T>)

Write the header to the serialized stream.

Declaration
public virtual void SerializeHeader(IConfigurationSerializationContext<T> context)
Parameters
Type Name Description
IConfigurationSerializationContext<T> context

The serialization context.

SerializeNode(BooleanConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates a System.Boolean.

Declaration
protected void SerializeNode(BooleanConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
BooleanConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(DecimalConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates a decimal value, implemented as a System.Double.

Contrary to the name, this is not implemented as a System.Decimal, and IEEE 754 floating point semantics for double precision floating point numbers should be taken into account.

Declaration
protected void SerializeNode(DecimalConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
DecimalConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(DeviceCapabilityElementConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates a ControllerElement.

This is only used when serializing syntax trees that came from IInputTemplate.

Declaration
protected void SerializeNode(DeviceCapabilityElementConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
DeviceCapabilityElementConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(EnumConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates an System.Enum value.

Declaration
protected void SerializeNode(EnumConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
EnumConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(IAbstractConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serialize a IAbstractConfigurationNode with the given context.

Declaration
public void SerializeNode(IAbstractConfigurationNode node, IConfigurationSerializationContext<T> context, int index = 0)
Parameters
Type Name Description
IAbstractConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(IntegralConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates an integral value, implemented as a System.Int64

Declaration
protected void SerializeNode(IntegralConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
IntegralConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(ListConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a list of configuration nodes.

For each child node to be serialized, the index should be incremented. Serializing a list node will enter a new block, and thus block headers and footers are written at the beginning and end of serialization of this node respectively.

Declaration
protected void SerializeNode(ListConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
ListConfigurationNode node

The list of configuration nodes represented as a ListConfigurationNode

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNode(StringConfigurationNode, IConfigurationSerializationContext<T>, Int32)

Serializes a configuration node that encapsulates a System.String.

Declaration
protected void SerializeNode(StringConfigurationNode node, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
StringConfigurationNode node

The node to serialize.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNodeValue(Boolean, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a BooleanConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializeNodeValue(bool value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
System.Boolean value

The raw value of the node.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNodeValue(Double, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a DecimalConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializeNodeValue(double value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
System.Double value

The raw value of the node.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNodeValue(Enum, String, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a EnumConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializeNodeValue(Enum enumValue, string value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
System.Enum enumValue

The value of the node as the System.Enum object.

System.String value

The raw value of the node.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNodeValue(Int64, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a IntegralConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializeNodeValue(long value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
System.Int64 value

The raw value of the node.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializeNodeValue(String, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a StringConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializeNodeValue(string value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
System.String value

The raw value of the node.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

SerializerNodeValue(ControllerElement, String, String, IConfigurationSerializationContext<T>, Int32)

Serializes the value of a EnumConfigurationNode. Override this when implementing a serializer.

Declaration
public abstract void SerializerNodeValue(ControllerElement controllerElementValue, string value, string key, IConfigurationSerializationContext<T> context, int index)
Parameters
Type Name Description
ControllerElement controllerElementValue

The value of the node

System.String value

The raw value of the node as the string representation of the element consistent with the IDeviceInputMapping the syntax tree was originally serialized with.

System.String key

The key of the node.

IConfigurationSerializationContext<T> context

The serialization context.

System.Int32 index

The position or index of the given node within the current block in the context.

Transform(IAbstractConfigurationNode)

Declaration
public abstract T Transform(IAbstractConfigurationNode node)
Parameters
Type Name Description
IAbstractConfigurationNode node
Returns
Type Description
T

Implements

IConfigurationTransformer<TOutput>
In This Article
  • Methods
    • SerializeBlockBegin(IConfigurationSerializationContext<T>, Int32)
    • SerializeBlockEnd(IConfigurationSerializationContext<T>, Int32)
    • SerializeFooter(IConfigurationSerializationContext<T>)
    • SerializeHeader(IConfigurationSerializationContext<T>)
    • SerializeNode(BooleanConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(DecimalConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(DeviceCapabilityElementConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(EnumConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(IAbstractConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(IntegralConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(ListConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNode(StringConfigurationNode, IConfigurationSerializationContext<T>, Int32)
    • SerializeNodeValue(Boolean, String, IConfigurationSerializationContext<T>, Int32)
    • SerializeNodeValue(Double, String, IConfigurationSerializationContext<T>, Int32)
    • SerializeNodeValue(Enum, String, String, IConfigurationSerializationContext<T>, Int32)
    • SerializeNodeValue(Int64, String, IConfigurationSerializationContext<T>, Int32)
    • SerializeNodeValue(String, String, IConfigurationSerializationContext<T>, Int32)
    • SerializerNodeValue(ControllerElement, String, String, IConfigurationSerializationContext<T>, Int32)
    • Transform(IAbstractConfigurationNode)
  • Implements
Built with ❤️ by @chyyran. Text content licensed under CC-BY-SA 4.0.