Skip to content

IJsonDocument

Definition

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

The interface explicitly implemented by JSON Document providers for internal use only.

public interface IJsonDocument : IDisposable

Implements

IDisposable

Implemented By

FixedJsonValueDocument<T>, FixedStringJsonDocument<T>, IMutableJsonDocument, IWorkspaceManagedDocument, JsonDocumentBuilder<T>, ParsedJsonDocument<T>

Properties

Property Type Description
CachedWorkspace JsonWorkspace Gets or sets the cached workspace that this document was last registered in.
CachedWorkspaceDocumentIndex int Gets or sets the cached document index within CachedWorkspace.
CachedWorkspaceGeneration int Gets or sets the workspace generation at the time of caching.
IsDisposable bool Gets a value indicating whether the document is disposable.
IsImmutable bool Gets a value indicating whether the document is immutable.

Methods

Method Description
AppendElementToMetadataDb(int, JsonWorkspace, ref MetadataDb) Appends the element at the specified index to the metadata database.
BuildRentedMetadataDb(int, JsonWorkspace, ref byte[]) Builds a rented metadata database for the specified parent document index.
CloneElement Clones the element at the specified index.
EnsurePropertyMap(int) Ensures the property map is available for the specified index.
GetArrayIndexElement Gets the element at the specified array index within the current index.
GetArrayInsertionIndex(int, int) Gets DB index of the item at the array index within the array that starts at currentIndex.
GetArrayLength(int) Gets the length of the array at the specified index.
GetDbSize(int, bool) Gets the size of the database for the element at the specified index.
GetHashCode(int) Gets the hash code for the specified index.
GetJsonTokenType(int) Gets the JSON token type for the specified index.
GetNameOfPropertyValue(int) Gets the name of the property value at the specified index.
GetPropertyCount(int) Gets the number of properties for the element at the specified index.
GetPropertyName(int) Gets the property name as a JSON element.
GetPropertyNameRaw Gets the raw property name as a byte span for the specified index.
GetPropertyNameUnescaped(int) Gets the property name as a JSON element.
GetPropertyRawValueAsString(int) Gets the raw value of the property at the specified index as a string.
GetRawSimpleValue Gets the raw simple value of the element at the specified index.
GetRawSimpleValueUnsafe(int) Gets the raw simple value of the element at the specified index, without checking if the document has been disposed.
GetRawValue(int, bool) Gets the raw value of the element at the specified index.
GetRawValueAsString(int) Gets the raw value of the element at the specified index as a string.
GetStartIndex(int) Gets the start index of the element from the end index.
GetString(int, JsonTokenType) Gets the string value of the element at the specified index.
GetUtf16JsonString(int, JsonTokenType) Gets the UTF-16 JSON string value of the element at the specified index.
GetUtf8JsonString(int, JsonTokenType) Gets the UTF-8 JSON string value of the element at the specified index.
TextEquals Determines whether the text at the specified index equals the specified text.
ToString Converts the element at the specified index to a string.
TryFindNextDescendantPropertyValue(int, ref int, ReadOnlySpan<byte>, ref int) Advances a linear scan over the subtree rooted at the element at elementIndex, returning the next property value whose unescaped name matches utf8PropertyName.
TryFormat Formats the value to the provided destination span according to the specified format and format provider.
TryGetLine Tries to get the specified line from the original source document as UTF-8 bytes.
TryGetLineAndOffset(int, ref int, ref int, ref long) Tries to get the line number and character offset in the original source document for the element at the specified index.
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.
TryGetNamedPropertyValue Tries to get the value of a named property as a JSON element.
TryGetString(int, JsonTokenType, ref string) Tries to get the string value of the element at the specified index.
TryGetValue Tries to get the value of the element at the specified index as a byte array.
TryResolveJsonPointer(ReadOnlySpan<byte>, int, ref TValue) Try to resolve the given JSON pointer.
ValueIsEscaped(int, bool) Determines whether the value at the specified index is escaped.
WriteElementTo(int, Utf8JsonWriter) Writes the element at the specified index to the provided JSON writer.
WriteElementToMetadataDb(int, JsonWorkspace, ref MetadataDb, int) Writes the element at the given index into the specified metadata database at a specific position, creating external reference rows. This is the positional variant of...
WritePropertyName(int, Utf8JsonWriter) Writes the property name at the specified index to the provided JSON writer.

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