Class YamlConverter<T>
- Namespace
- Codebelt.Extensions.YamlDotNet.Converters
- Assembly
- Codebelt.Extensions.YamlDotNet.dll
Converts an object to or from YAML (YAML ain't markup language).
public abstract class YamlConverter<T> : YamlConverter, IYamlTypeConverter
Type Parameters
TThe type of object or value handled by the converter.
- Inheritance
-
YamlConverter<T>
- Implements
-
IYamlTypeConverter
- Derived
- Inherited Members
Methods
CanConvert(Type)
Determines whether this instance can convert the specified object type.
public override bool CanConvert(Type typeToConvert)
Parameters
Returns
- bool
trueif this instance can convert the specified object type; otherwise,false.
ReadYaml(IParser, Type)
Reads and converts the YAML to type T.
public abstract T ReadYaml(IParser reader, Type typeToConvert)
Parameters
readerIParserThe reader to read from.
typeToConvertTypeThe type to convert.
Returns
- T
The converted value.
WriteYaml(IEmitter, T)
Writes a specified value as YAML.
public abstract void WriteYaml(IEmitter writer, T value)
Parameters
writerIEmitterThe writer to write to.
valueTThe value to convert to YAML.