YamlStreamDocument Class
A document of a YamlStream: its directives and markers, and its root node in YamlStreamDocument.Contents.
public class YamlStreamDocumentRemarks
For a read-only document that does not create an object per node, see YamlDocument.
Constructors
| Name | Description |
|---|---|
| YamlStreamDocument() | Initializes a new instance of this type. |
YamlStreamDocument()
YamlStreamDocument.csInitializes a new instance of this type.
public YamlStreamDocument()Properties
| Name | Description |
|---|---|
| Contents | Gets contents. |
| DocumentEnd | Gets document End. |
| DocumentStart | Gets document Start. |
Contents
YamlStreamDocument.csDocumentEnd
YamlStreamDocument.csDocumentStart
YamlStreamDocument.csMethods
| Name | Description |
|---|---|
| DeepClone() | Creates a deep clone of the current value. |
| EnumerateEvents() | Enumerates the parsing events of the document. |
| Load(EventReader) | Loads data. |
| Load(EventReader, YamlSerializerOptions?) | Loads data, honoring the anchor, alias and alias-expansion limits of options. |
| ToObject(Type, YamlSerializerOptions?) | Converts the document to an object. |
| ToObject<T>(YamlSerializerOptions?) | Converts the document to an instance of T. |
| ToString() | Returns a string representation of the current instance. |
| WriteTo(IEmitter, bool) | Writes the document as YAML. |
| WriteTo(TextWriter, bool) | Writes the document as YAML. |
DeepClone()
YamlStreamDocument.csEnumerateEvents()
YamlStreamDocument.csEnumerates the parsing events of the document.
public IEnumerable<ParsingEvent> EnumerateEvents()Returns
Load overloads
Load(EventReader)
YamlStreamDocument.csLoads data.
public static YamlStreamDocument Load(EventReader eventReader)Load(EventReader, YamlSerializerOptions?)
YamlStreamDocument.csLoads data, honoring the anchor, alias and alias-expansion limits of options.
public static YamlStreamDocument Load(EventReader eventReader, YamlSerializerOptions? options)Parameters
eventReaderEventReader- The event reader.
optionsYamlSerializerOptions?- The options used to bound alias expansion. If
null,YamlSerializerOptions.Defaultis used.
Returns
ToObject overloads
ToObject(Type, YamlSerializerOptions?)
YamlStreamDocument.csConverts the document to an object.
public object? ToObject(Type type, YamlSerializerOptions? options = null)ToObject<T>(YamlSerializerOptions?)
YamlStreamDocument.csConverts the document to an instance of T.
public T? ToObject<T>(YamlSerializerOptions? options = null)ToString()
YamlStreamDocument.csWriteTo overloads
WriteTo(IEmitter, bool)
YamlStreamDocument.csWriteTo(TextWriter, bool)
YamlStreamDocument.csWrites the document as YAML.
public void WriteTo(TextWriter writer, bool suppressDocumentTags = false)Parameters
writerTextWritersuppressDocumentTagsbool