YamlStream Class
Represents the Yaml Stream.
public class YamlStream : YamlNode, ICollection<YamlDocument>, IEnumerable<YamlDocument>, IList<YamlDocument>, IEnumerable- Inheritance
YamlNodeYamlStream- Implements
Constructors
| Name | Description |
|---|---|
| YamlStream() | Initializes a new instance of this type. |
YamlStream()
YamlStream.csInitializes a new instance of this type.
public YamlStream()Properties
| Name | Description |
|---|---|
| Count | Gets count. |
| IsReadOnly | Gets a value indicating whether is Read Only. |
Count
YamlStream.csIsReadOnly
YamlStream.csIndexers
| Name | Description |
|---|---|
| this[int] | Gets or sets an element at the specified index. |
this[int]
YamlStream.csGets or sets an element at the specified index.
public YamlDocument this[int index] { get; set; }Methods
| Name | Description |
|---|---|
| Add(YamlDocument) | Adds an item. |
| Clear() | Removes all elements from the collection. |
| Contains(YamlDocument) | Determines whether a value exists. |
| CopyTo(YamlDocument[], int) | Copies the elements to an array starting at the specified index. |
| DeepClone() | Creates a deep clone of the current value. |
| GetEnumerator() | Gets enumerator. |
| IndexOf(YamlDocument) | Gets the zero-based index of the specified item. |
| Insert(int, YamlDocument) | Inserts an item at the specified index. |
| Load(EventReader) | Loads data. |
| Load(EventReader, YamlSerializerOptions?) | Loads data, honoring the anchor, alias and alias-expansion limits of options. |
| Load(TextReader) | Loads data. |
| Load(TextReader, YamlSerializerOptions?) | Loads data, honoring the hardening options in options. |
| Remove(YamlDocument) | Removes an item. |
| RemoveAt(int) | Removes at. |
| System.Collections.IEnumerable.GetEnumerator() |
Add(YamlDocument)
YamlStream.csClear()
YamlStream.csRemoves all elements from the collection.
public void Clear()Contains(YamlDocument)
YamlStream.csDetermines whether a value exists.
public bool Contains(YamlDocument item)CopyTo(YamlDocument[], int)
YamlStream.csCopies the elements to an array starting at the specified index.
public void CopyTo(YamlDocument[] array, int arrayIndex)Parameters
arrayYamlDocument[]arrayIndexint
DeepClone()
YamlStream.csGetEnumerator()
YamlStream.csIndexOf(YamlDocument)
YamlStream.csGets the zero-based index of the specified item.
public int IndexOf(YamlDocument item)Insert(int, YamlDocument)
YamlStream.csInserts an item at the specified index.
public void Insert(int index, YamlDocument item)Parameters
indexintitemYamlDocument
Load overloads
Load(EventReader)
YamlStream.csLoads data.
public static YamlStream Load(EventReader eventReader)Load(EventReader, YamlSerializerOptions?)
YamlStream.csLoads data, honoring the anchor, alias and alias-expansion limits of options.
public static YamlStream Load(EventReader eventReader, YamlSerializerOptions? options)Parameters
eventReaderEventReader- The event reader.
optionsYamlSerializerOptions?- The options used to bound alias expansion. If
null,YamlSerializerOptions.Defaultis used.
Returns
Load(TextReader)
YamlStream.csLoads data.
public static YamlStream Load(TextReader stream)Load(TextReader, YamlSerializerOptions?)
YamlStream.csLoads data, honoring the hardening options in options.
public static YamlStream Load(TextReader stream, YamlSerializerOptions? options)Parameters
streamTextReader- The reader over the YAML payload.
optionsYamlSerializerOptions?- The options used to bound nesting depth and alias expansion. If
null,YamlSerializerOptions.Defaultis used.
Returns
Remarks
Use this overload for untrusted input: it applies YamlSerializerOptions.MaxDepth, YamlSerializerOptions.AllowAnchors, YamlSerializerOptions.AllowAliases and YamlSerializerOptions.MaxAliasExpansionNodeCount.