YamlMarshal class

An unsafe class that provides a set of methods to access the underlying data representations of YAML types.

Namespace: System.Runtime.InteropServices ยท Assembly: Styml.dll

public static class YamlMarshal

An unsafe class that provides a set of methods to access the underlying data representations of YAML types.

MethodsLink to this heading

GetRawUtf8PropertyNameLink to this heading

Gets a ReadOnlySpan<T> view over the raw YAML data of the given YamlProperty name.

public static ReadOnlySpan<byte> GetRawUtf8PropertyName(YamlProperty property);

Parameters

  • property: The YAML property from which to extract the span.

Returns: The span containing the raw YAML data of the property name. This will not include the enclosing quotes.

Exception Condition
ObjectDisposedException The underlying YamlDocument has been disposed.

While the method itself does check for disposal of the underlying YamlDocument, it is possible that it could be disposed after the method returns, which would result in the span pointing to a buffer that has been returned to the shared pool. Callers should take extra care to make sure that such a scenario isn't possible to avoid potential data corruption.

GetRawUtf8ValueLink to this heading

Gets a ReadOnlySpan<T> view over the raw YAML data of the given YamlElement.

public static ReadOnlySpan<byte> GetRawUtf8Value(YamlElement element);

Parameters

  • element: The YAML element from which to extract the span.

Returns: The span containing the raw YAML data ofelement.

Exception Condition
ObjectDisposedException The underlying YamlDocument has been disposed.

While the method itself does check for disposal of the underlying YamlDocument, it is possible that it could be disposed after the method returns, which would result in the span pointing to a buffer that has been returned to the shared pool. Callers should take extra care to make sure that such a scenario isn't possible to avoid potential data corruption.

Generated from the XML documentation of the libraryBuilt with Douze

Esc to close