Skip to content

IJsonDocument.TryGetLineAndOffsetForPointer Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: IJsonDocument.cs

TryGetLineAndOffsetForPointer(ReadOnlySpan<byte>, int, int, int, long)

Resolves a JSON pointer against the element at the specified index and gets the line number and character offset of the target element in the original source document.

public abstract bool TryGetLineAndOffsetForPointer(ReadOnlySpan<byte> jsonPointer, int index, out int line, out int charOffset, out long lineByteOffset)

Parameters

Name Type Description
jsonPointer ReadOnlySpan<byte> The JSON pointer to resolve.
index int The index of the element at the root of the pointer resolution.
line int When this method returns, contains the 1-based line number if successful.
charOffset int When this method returns, contains the 1-based character offset within the line if successful.
lineByteOffset long When this method returns, contains the byte offset of the start of the line if successful.

Returns

bool

true if the pointer was resolved and the line and offset were successfully determined; otherwise, false.

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