YamlStream Class

Implements

Constructors

NameDescription
YamlStream()Initializes a new instance of this type.

YamlStream()

YamlStream.cs

Initializes a new instance of this type.

public YamlStream()

Properties

NameDescription
CountGets count.
IsReadOnlyGets a value indicating whether is Read Only.

Gets count.

public int Count { get; }

Property value

int

IsReadOnly

YamlStream.cs

Gets a value indicating whether is Read Only.

public bool IsReadOnly { get; }

Property value

bool

Indexers

NameDescription
this[int]Gets or sets an element at the specified index.

this[int]

YamlStream.cs

Gets or sets an element at the specified index.

public YamlStreamDocument this[int index] { get; set; }

Parameters

index int

Property value

YamlStreamDocument

Methods

NameDescription
Add(YamlStreamDocument)Adds an item.
Clear()Removes all elements from the collection.
Contains(YamlStreamDocument)Determines whether a value exists.
CopyTo(YamlStreamDocument[], int)Copies the elements to an array starting at the specified index.
DeepClone()Creates a deep clone of the current value.
EnumerateEvents()Enumerates the parsing events of the stream.
GetEnumerator()Gets enumerator.
IndexOf(YamlStreamDocument)Gets the zero-based index of the specified item.
Insert(int, YamlStreamDocument)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(YamlStreamDocument)Removes an item.
RemoveAt(int)Removes at.
System.Collections.IEnumerable.GetEnumerator()
ToObject(Type, YamlSerializerOptions?)Converts the stream to an object.
ToObject<T>(YamlSerializerOptions?)Converts the stream to an instance of T.
ToString()Returns a string representation of the current instance.
ToStringPreservingFormatting()Returns the stream as the text it was loaded from, in which only the nodes that changed since are rewritten. See YamlStream.WritePreservingFormatting.
WritePreservingFormatting(TextWriter)Writes the stream as the text it was loaded from, in which only the nodes that changed since are rewritten. The rest of the text, comments, blank lines and formatting included, is copied byte for byte.
WriteTo(IEmitter, bool)Writes the stream as YAML.
WriteTo(TextWriter, bool)Writes the stream as YAML.

Add(YamlStreamDocument)

YamlStream.cs

Adds an item.

public void Add(YamlStreamDocument item)

Parameters

item YamlStreamDocument

Removes all elements from the collection.

public void Clear()

Contains(YamlStreamDocument)

YamlStream.cs

Determines whether a value exists.

public bool Contains(YamlStreamDocument item)

Parameters

item YamlStreamDocument

Returns

bool

CopyTo(YamlStreamDocument[], int)

YamlStream.cs

Copies the elements to an array starting at the specified index.

public void CopyTo(YamlStreamDocument[] array, int arrayIndex)

Parameters

array YamlStreamDocument[]
arrayIndex int

DeepClone()

YamlStream.cs

Creates a deep clone of the current value.

public YamlStream DeepClone()

Returns

YamlStream

EnumerateEvents()

YamlStream.cs

Enumerates the parsing events of the stream.

public IEnumerable<ParsingEvent> EnumerateEvents()

GetEnumerator()

YamlStream.cs

Gets enumerator.

public IEnumerator<YamlStreamDocument> GetEnumerator()

IndexOf(YamlStreamDocument)

YamlStream.cs

Gets the zero-based index of the specified item.

public int IndexOf(YamlStreamDocument item)

Parameters

item YamlStreamDocument

Returns

int

Insert(int, YamlStreamDocument)

YamlStream.cs

Inserts an item at the specified index.

public void Insert(int index, YamlStreamDocument item)

Parameters

index int
item YamlStreamDocument

Load overloads

Load(EventReader)

YamlStream.cs

Loads data.

public static YamlStream Load(EventReader eventReader)
Parameters
eventReader EventReader
Returns

YamlStream

Load(EventReader, YamlSerializerOptions?)

YamlStream.cs

Loads data, honoring the anchor, alias and alias-expansion limits of options.

public static YamlStream Load(EventReader eventReader, YamlSerializerOptions? options)
Parameters
eventReader EventReader
The event reader.
options YamlSerializerOptions?
The options used to bound alias expansion. If null, YamlSerializerOptions.Default is used.
Returns

YamlStream

Load(TextReader)

YamlStream.cs

Loads data.

public static YamlStream Load(TextReader stream)
Parameters
stream TextReader
Returns

YamlStream

Load(TextReader, YamlSerializerOptions?)

YamlStream.cs

Loads data, honoring the hardening options in options.

public static YamlStream Load(TextReader stream, YamlSerializerOptions? options)
Parameters
stream TextReader
The reader over the YAML payload.
options YamlSerializerOptions?
The options used to bound nesting depth and alias expansion. If null, YamlSerializerOptions.Default is used.
Returns

YamlStream

Remarks

Remove(YamlStreamDocument)

YamlStream.cs

Removes an item.

public bool Remove(YamlStreamDocument item)

Parameters

item YamlStreamDocument

Returns

bool

RemoveAt(int)

YamlStream.cs

Removes at.

public void RemoveAt(int index)

Parameters

index int

System.Collections.IEnumerable.GetEnumerator()

YamlStream.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

ToObject overloads

ToObject(Type, YamlSerializerOptions?)

YamlStream.cs

Converts the stream to an object.

public object? ToObject(Type type, YamlSerializerOptions? options = null)
Parameters
type Type
options YamlSerializerOptions?
Returns

object?

ToObject<T>(YamlSerializerOptions?)

YamlStream.cs

Converts the stream to an instance of T.

public T? ToObject<T>(YamlSerializerOptions? options = null)
Type parameters
T
Parameters
options YamlSerializerOptions?
Returns

T?

ToString()

YamlStream.cs

Returns a string representation of the current instance.

public override string ToString()

Returns

string

ToStringPreservingFormatting()

YamlStream.cs

Returns the stream as the text it was loaded from, in which only the nodes that changed since are rewritten. See YamlStream.WritePreservingFormatting.

public string ToStringPreservingFormatting()

Returns

string

WritePreservingFormatting(TextWriter)

YamlStream.cs

Writes the stream as the text it was loaded from, in which only the nodes that changed since are rewritten. The rest of the text, comments, blank lines and formatting included, is copied byte for byte.

public void WritePreservingFormatting(TextWriter writer)

Parameters

writer TextWriter

Exceptions

ArgumentNullException
writer is null.

Remarks

A changed scalar replaces the text of the scalar. An entry added to or removed from a block mapping or sequence adds or removes its lines. Other changes, such as reordered entries or a changed flow collection, rewrite the smallest node that contains them. A stream that was not loaded from a text is written like YamlStream.WriteTo, without its comments and layout. So is a stream whose changes rewrite ranges of the text that overlap.

WriteTo overloads

WriteTo(IEmitter, bool)

YamlStream.cs

Writes the stream as YAML.

public void WriteTo(IEmitter emitter, bool suppressDocumentTags = false)
Parameters
emitter IEmitter
suppressDocumentTags bool

WriteTo(TextWriter, bool)

YamlStream.cs

Writes the stream as YAML.

public void WriteTo(TextWriter writer, bool suppressDocumentTags = false)
Parameters
writer TextWriter
suppressDocumentTags bool