IJsonDocument.TryGetLineAndOffsetForPointer Method
Definition
Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: IJsonDocument.cs
TryGetLineAndOffsetForPointer(ReadOnlySpan<byte>, int, ref int, ref int, ref 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, ref int line, ref int charOffset, ref 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 |
ref int |
When this method returns, contains the 1-based line number if successful. |
charOffset |
ref int |
When this method returns, contains the 1-based character offset within the line if successful. |
lineByteOffset |
ref long |
When this method returns, contains the byte offset of the start of the line if successful. |
Returns
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