-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Core.IO.Wrapper.Classes
Base class for wrapping serializable objects into a structure that can be persisted and retrieved using unique references.
public abstract class Wrapper : System.IDisposableInheritance System.Object → Wrapper
Implements System.IDisposable
Initializes a new instance of the Wrapper class.
public Wrapper();Adds a serializable object to the wrapper and returns its unique reference.
public DiGi.Core.Classes.UniqueReference? Add(DiGi.Core.Interfaces.ISerializableObject? value);value DiGi.Core.Interfaces.ISerializableObject
The serializable object to add.
DiGi.Core.Classes.UniqueReference
A DiGi.Core.Classes.UniqueReference for the added object, or null.
Adds a double value to the wrapper and returns its unique identifier reference.
public DiGi.Core.Classes.UniqueIdReference? Add(double value);value System.Double
The double value to add.
DiGi.Core.Classes.UniqueIdReference
A DiGi.Core.Classes.UniqueIdReference for the added value, or null.
Adds a string value to the wrapper and returns its unique identifier reference.
public DiGi.Core.Classes.UniqueIdReference? Add(string? value);value System.String
The string value to add.
DiGi.Core.Classes.UniqueIdReference
A DiGi.Core.Classes.UniqueIdReference for the added value, or null.
Adds a collection of serializable objects to the wrapper and returns their unique references.
public System.Collections.Generic.List<DiGi.Core.Classes.UniqueReference>? AddRange<TSerializableObject>(System.Collections.Generic.IEnumerable<TSerializableObject>? serializableObjects)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of serializable objects being added.
serializableObjects System.Collections.Generic.IEnumerable<TSerializableObject>
The collection of serializable objects to add.
System.Collections.Generic.List<DiGi.Core.Classes.UniqueReference>
A list of DiGi.Core.Classes.UniqueReference for the added objects, or null.
Clears the cached content of the file.
public void Clear();Releases all resources used by the watcher.
public void Dispose();Implements Dispose()
Parses and returns the file content as a list of JSON nodes.
public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode?>? GetJsonNodes();System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of System.Text.Json.Nodes.JsonNode objects, or null if the operation fails.
Retrieves metadata associated with the file.
public TMetadata? GetMetadata<TMetadata>()
where TMetadata : DiGi.Core.IO.Interfaces.IMetadata;TMetadata
The type of metadata to retrieve.
TMetadata
The metadata object of type TMetadata, or null if not found.
Retrieves all serializable objects from the file content.
public System.Collections.Generic.List<DiGi.Core.Interfaces.ISerializableObject>? GetSerializableObjects();System.Collections.Generic.List<DiGi.Core.Interfaces.ISerializableObject>
A list of objects implementing DiGi.Core.Interfaces.ISerializableObject, or null.
Retrieves all serializable objects of a specific type from the file content.
public System.Collections.Generic.List<TSerializableObject>? GetSerializableObjects<TSerializableObject>()
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of serializable objects to retrieve.
System.Collections.Generic.List<TSerializableObject>
A list of serializable objects of type TSerializableObject, or null.
Reads the file and returns its content as a list of JSON nodes.
public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>? Read();System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of System.Text.Json.Nodes.JsonNode objects representing the file content, or null.
Reads JSON nodes associated with the provided unique references.
public System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>? Read(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? uniqueReferences);uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
The collection of unique references to read.
System.Collections.Generic.List<System.Text.Json.Nodes.JsonNode>
A list of JSON nodes corresponding to the provided references, or null.
Reads a single serializable object from the file using its unique reference.
public TSerializableObject? Read<TSerializableObject>(DiGi.Core.Classes.UniqueReference? uniqueReference)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of the serializable object to read.
uniqueReference DiGi.Core.Classes.UniqueReference
The unique reference of the object to read.
TSerializableObject
The deserialized object of type TSerializableObject, or null.
Reads specific serializable objects from the file based on the provided references.
public System.Collections.Generic.List<TSerializableObject>? Read<TSerializableObject>(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference> uniqueReferences)
where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;TSerializableObject
The type of serializable objects to read.
uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
A collection of unique references used to identify the objects to be read.
System.Collections.Generic.List<TSerializableObject>
A list of serializable objects of type TSerializableObject, or null if no objects were found.
Sets the metadata for the file content.
public void SetMetadata(DiGi.Core.IO.Interfaces.IMetadata metadata);metadata DiGi.Core.IO.Interfaces.IMetadata
The metadata to set.
Writes all current objects to the file.
public System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? Write();System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
A collection of unique references for the written objects, or null.
Writes specific objects to the file based on the provided references.
public System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? Write(System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>? uniqueReferences);uniqueReferences System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
The collection of unique references to write.
System.Collections.Generic.IEnumerable<DiGi.Core.Classes.UniqueReference>
A collection of unique references for the written objects, or null.
Represents a wrapper item containing a unique reference and associated data.
public sealed class WrapperItem : DiGi.Core.IO.Wrapper.Interfaces.IWrapperObject, DiGi.Core.IO.Interfaces.IIOObject, DiGi.Core.Interfaces.IObjectInheritance System.Object → WrapperItem
Implements DiGi.Core.IO.Wrapper.Interfaces.IWrapperObject, DiGi.Core.IO.Interfaces.IIOObject, DiGi.Core.Interfaces.IObject
Initializes a new instance of the WrapperItem class with a specified unique reference.
public WrapperItem(DiGi.Core.Classes.UniqueReference? uniqueReference);uniqueReference DiGi.Core.Classes.UniqueReference
The unique reference for the item.
Initializes a new instance of the WrapperItem class with a unique reference, JSON node, and checksum.
public WrapperItem(DiGi.Core.Classes.UniqueReference? uniqueReference, System.Text.Json.Nodes.JsonNode? jsonNode, string? checksum);uniqueReference DiGi.Core.Classes.UniqueReference
The unique reference for the item.
jsonNode System.Text.Json.Nodes.JsonNode
The JSON node associated with the item.
checksum System.String
The checksum of the item.
Gets or sets the checksum associated with the wrapper item.
public string? Checksum { get; set; }Gets or sets the JSON node data associated with the wrapper item.
public System.Text.Json.Nodes.JsonNode? JsonNode { get; set; }System.Text.Json.Nodes.JsonNode
Gets or sets the unique reference for the wrapper item.
public DiGi.Core.Classes.UniqueReference? UniqueReference { get; }DiGi.Core.Classes.UniqueReference
Represents a cluster of wrapper item values.
public class WrapperItemValueCluster : DiGi.Core.Classes.ValueCluster<DiGi.Core.Classes.TypeReference, DiGi.Core.Classes.UniqueReference, DiGi.Core.IO.Wrapper.Classes.WrapperItem>Inheritance System.Object → DiGi.Core.Classes.Cluster<DiGi.Core.Classes.TypeReference,DiGi.Core.Classes.UniqueReference,WrapperItem> → DiGi.Core.Classes.ValueCluster<DiGi.Core.Classes.TypeReference,DiGi.Core.Classes.UniqueReference,WrapperItem> → WrapperItemValueCluster
Initializes a new instance of the WrapperItemValueCluster class.
public WrapperItemValueCluster();Retrieves the JSON value associated with the specified unique reference.
public System.Text.Json.Nodes.JsonNode? GetValue(DiGi.Core.Classes.UniqueReference? uniqueReference);uniqueReference DiGi.Core.Classes.UniqueReference
The unique reference used to identify the value.
System.Text.Json.Nodes.JsonNode
The JSON value associated with the specified unique reference, or null if not found.
Retrieves the typed JSON value associated with the specified unique reference.
public TJsonNode? GetValue<TJsonNode>(DiGi.Core.Classes.UniqueReference? uniqueReference)
where TJsonNode : System.Text.Json.Nodes.JsonNode;TJsonNode
The type of the JSON node to return.
uniqueReference DiGi.Core.Classes.UniqueReference
The unique reference used to identify the value.
TJsonNode
The typed JSON value associated with the specified unique reference, or null if not found.