Table of Contents

YamlValue Class

Definition

Namespace
Bodu.Text.Yaml.Nodes
Assembly
Bodu.Text.Yaml.dll
Package
Bodu.Text.Yaml 1.0.0
Source
YamlValue.cs

Represents a scalar node in a mutable YAML document object model.

public sealed class YamlValue : YamlNode
Inheritance
YamlValue
Inherited Members
Extension Methods

Properties

ValueKind

Gets the kind of the scalar value.

public YamlValueKind ValueKind { get; }

Property Value

YamlValueKind

The value kind.

Methods

Create(bool)

Creates a boolean scalar.

public static YamlValue Create(bool value)

Parameters

value bool

The boolean value.

Returns

YamlValue

The scalar node.

Create(double)

Creates a floating-point scalar.

public static YamlValue Create(double value)

Parameters

value double

The floating-point value.

Returns

YamlValue

The scalar node.

Create(long)

Creates an integer scalar.

public static YamlValue Create(long value)

Parameters

value long

The integer value.

Returns

YamlValue

The scalar node.

Create(string)

Creates a string scalar.

public static YamlValue Create(string value)

Parameters

value string

The string value.

Returns

YamlValue

The scalar node.

GetValue<T>()

Gets the scalar value converted to the requested type.

public T GetValue<T>()

Returns

T

The converted value.

Type Parameters

T

The desired value type.

Exceptions

InvalidOperationException

The value cannot be converted to T.

WriteTo(Utf8YamlWriter)

Writes this node to the given writer.

public override void WriteTo(Utf8YamlWriter writer)

Parameters

writer Utf8YamlWriter

The writer to emit into.

Applies to

ProductVersions
.NET8, 10