Class YamlConverter<T>
- Namespace
- Cuemon.Text.Yaml.Converters
- Assembly
- Cuemon.Core.dll
Converts an object to or from YAML (YAML ain't markup language).
[Obsolete("All YAML marshalling has been moved to its own assembly; Cuemon.Extensions.YamlDotNet. This member will be removed with next major version.")]
public abstract class YamlConverter<T> : YamlConverter
Type Parameters
T
The type of object or value handled by the converter.
- Inheritance
-
ObjectYamlConverter<T>
- Derived
- Extension Methods
Methods
CanConvert(Type)
Determines whether this instance can convert the specified object type.
public override bool CanConvert(Type typeToConvert)
Parameters
typeToConvert
TypeThe System.Type of the object.
Returns
- Boolean
true
if this instance can convert the specified object type; otherwise,false
.
ReadYaml(YamlTextReader, Type, YamlSerializerOptions)
Reads and converts the YAML to type T
.
public abstract T ReadYaml(YamlTextReader reader, Type typeToConvert, YamlSerializerOptions so)
Parameters
reader
YamlTextReaderThe reader to read from.
typeToConvert
TypeThe type to convert.
so
YamlSerializerOptionsAn object that specifies serialization options to use.
Returns
- T
The converted value.
WriteYaml(YamlTextWriter, T, YamlSerializerOptions)
Writes a specified value
as YAML.
public abstract void WriteYaml(YamlTextWriter writer, T value, YamlSerializerOptions so)
Parameters
writer
YamlTextWriterThe writer to write to.
value
TThe value to convert to YAML.
so
YamlSerializerOptionsAn object that specifies serialization options to use.