Skip to content

IJsonDocument.TryGetJsonPointer Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll

Overloads

Method Description
TryGetJsonPointer(int, Span<byte>, int, int) Tries to write the JSON Pointer (RFC 6901) of the element at the specified index, relative to the document root, as UTF-8 bytes.
TryGetJsonPointer(int, Span<char>, int, int) Tries to write the JSON Pointer (RFC 6901) of the element at the specified index, relative to the document root, as UTF-16 characters.

TryGetJsonPointer(int, Span<byte>, int, int)

Source: IJsonDocument.cs

Tries to write the JSON Pointer (RFC 6901) of the element at the specified index, relative to the document root, as UTF-8 bytes.

public abstract bool TryGetJsonPointer(int index, Span<byte> utf8Destination, out int bytesWritten, out int bytesRequired)

Parameters

Name Type Description
index int The index of the element.
utf8Destination Span<byte> The destination for the UTF-8 pointer text.
bytesWritten int The number of bytes written on success; 0 on failure.
bytesRequired int The total number of bytes the pointer requires, whether or not it fit in the destination.

Returns

bool

true if the pointer was written; false if the destination was too small.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

TryGetJsonPointer(int, Span<char>, int, int)

Source: IJsonDocument.cs

Tries to write the JSON Pointer (RFC 6901) of the element at the specified index, relative to the document root, as UTF-16 characters.

public abstract bool TryGetJsonPointer(int index, Span<char> destination, out int charsWritten, out int charsRequired)

Parameters

Name Type Description
index int The index of the element.
destination Span<char> The destination for the pointer text.
charsWritten int The number of characters written on success; 0 on failure.
charsRequired int The total number of characters the pointer requires, whether or not it fit in the destination.

Returns

bool

true if the pointer was written; false if the destination was too small.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue