Skip to content

IMutableJsonDocument

Definition

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

Represents a mutable JSON document that supports editing and value storage operations.

public interface IMutableJsonDocument : IWorkspaceManagedDocument, IJsonDocument, IDisposable

Implements

IWorkspaceManagedDocument, IJsonDocument, IDisposable

Implemented By

JsonDocumentBuilder<T>

Properties

Property Type Description
ParentWorkspaceIndex int Gets the index of the parent workspace.
Version ulong Gets the version of the document.
Workspace JsonWorkspace Gets the JSON workspace associated with this document.

Methods

Method Description
CopyValueToArrayEnd(int, int) Copies a value and appends it at the end of a destination array.
CopyValueToArrayIndex(int, int, int) Copies a value and inserts it as an array item at the specified index.
CopyValueToProperty(int, int, ReadOnlySpan<byte>) Copies a value and sets it as a property on a destination object. If the property already exists, it is replaced.
EscapeAndStoreRawStringValue Escapes and stores a raw string value in the document.
FreezeElement(int) Creates a frozen (immutable) copy of the element at the specified index, backed by a new document builder registered in the same workspace.
GetArrayIndexElement Gets the array element at the specified index as a mutable JSON element.
InsertAndDispose(int, int, ref ComplexValueBuilder) Inserts a value into the document and disposes the provided ComplexValueBuilder.
InsertFromDocument(int, int, int, IJsonDocument, int) Inserts element rows from a source document directly, bypassing ComplexValueBuilder.
InsertPropertyFromDocument(int, int, int, ReadOnlySpan<byte>, IJsonDocument, int) Inserts a property name row followed by element rows from a source document, bypassing ComplexValueBuilder.
InsertSimpleProperty(int, int, int, ReadOnlySpan<byte>, JsonTokenType, int, int) Inserts a property name and a single simple value row directly, bypassing ComplexValueBuilder.
InsertSimpleValue(int, int, int, JsonTokenType, int, int) Inserts a single simple value row directly into a complex object, bypassing ComplexValueBuilder.
MoveItemToArray(int, int, int, int) Moves an array item from a source array into a destination array at the specified index. Handles same-array moves with post-removal index semantics.
MoveItemToArrayEnd(int, int, int) Moves an array item from a source array to the end of a destination array.
MoveItemToProperty(int, int, int, ReadOnlySpan<byte>) Moves an array item from a source array to a destination object as a new property. Handles removing existing destination properties.
MovePropertyToArray(int, ReadOnlySpan<byte>, int, int) Moves a property from a source object into a destination array at the specified index.
MovePropertyToArrayEnd(int, ReadOnlySpan<byte>, int) Moves a property from a source object to the end of a destination array.
MovePropertyToProperty(int, ReadOnlySpan<byte>, int, ReadOnlySpan<byte>) Moves a property from a source object to a destination object as a new property. Handles removing existing destination properties and same-property no-ops.
OverwriteAndDispose(int, int, int, int, ref ComplexValueBuilder) Overwrites values in the document and disposes the provided ComplexValueBuilder.
OverwriteFromDocument(int, int, int, int, IJsonDocument, int) Overwrites a range with element rows from a source document, bypassing ComplexValueBuilder.
OverwriteSimpleValue(int, int, int, int, JsonTokenType, int, int) Overwrites a range with a single simple value row directly, bypassing ComplexValueBuilder.
RemoveRange(int, int, int, int) Removes a range of values from the document.
ReplaceRootAndDispose(ref ComplexValueBuilder) Replaces the root value of an already-initialized document, disposing the old value and the provided ComplexValueBuilder.
SetAndDispose(ref ComplexValueBuilder) Sets the value of the document and disposes the provided ComplexValueBuilder.
StoreBooleanValue(bool) Stores a boolean value in the document.
StoreNullValue() Stores a null value in the document.
StorePrebakedValue(ReadOnlySpan<byte>) Stores a pre-baked dynamic value in the value buffer and returns its offset. The value must contain the complete encoded representation including the 4-byte header.
StoreRawNumberValue(ReadOnlySpan<byte>) Stores a raw number value in the document.
StoreRawStringValue(ReadOnlySpan<byte>) Stores a raw string value in the document.
StoreValue Stores a Guid value in the document.
TryGetNamedPropertyValue
TryGetNamedPropertyValueIndex Gets the named property value from a specific MetadataDb.
TryReplacePropertyFromDocument(int, ReadOnlySpan<byte>, IJsonDocument, int) Replaces an existing property value with element rows from a source document.
TryReplacePropertyValue(int, ReadOnlySpan<byte>, JsonTokenType, int, int) Replaces an existing property value with a simple scalar value.

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