Show / Hide Table of Contents

Class DefaultKeyValueStore

The default built-in IKeyValueStore implementation. This stores data in the file system or in memory.

Inheritance
Object
DefaultKeyValueStore
Implements
IKeyValueStore
IDisposable
Namespace: Libplanet.Store.Trie
Assembly: Libplanet.dll
Syntax
public class DefaultKeyValueStore : object, IKeyValueStore, IDisposable

Constructors

| Improve this Doc View Source

DefaultKeyValueStore(Nullable<String>)

Creates a new DefaultKeyValueStore.

Declaration
public DefaultKeyValueStore(string? path)
Parameters
Type Name Description
Nullable<String> path

The path of the directory where the storage files will be saved. If the path is null, the database is created in memory.

Methods

| Improve this Doc View Source

Delete(Byte[])

Declaration
public void Delete(byte[] key)
Parameters
Type Name Description
Byte[] key
| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

Exists(Byte[])

Declaration
public bool Exists(byte[] key)
Parameters
Type Name Description
Byte[] key
Returns
Type Description
Boolean
| Improve this Doc View Source

Get(Byte[])

Declaration
public byte[] Get(byte[] key)
Parameters
Type Name Description
Byte[] key
Returns
Type Description
Byte[]
| Improve this Doc View Source

ListKeys()

Lists all keys that have been stored in the storage.

Declaration
public IEnumerable<byte[]> ListKeys()
Returns
Type Description
IEnumerable<Byte[]>

All keys in an arbitrary order. The order might be vary for each call.

| Improve this Doc View Source

Set(Byte[], Byte[])

Declaration
public void Set(byte[] key, byte[] value)
Parameters
Type Name Description
Byte[] key
Byte[] value

Implements

IKeyValueStore
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2021 Planetarium