6 namespace org { namespace ldk { namespace structs {
10 * A [`KVStore`] implementation that writes to and reads from the file system.
12 public class FilesystemStore : CommonBase {
13 internal FilesystemStore(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.FilesystemStore_free(ptr); }
19 * Constructs a new [`FilesystemStore`].
21 public static FilesystemStore of(string data_dir) {
22 long ret = bindings.FilesystemStore_new(InternalUtils.encodeString(data_dir));
23 GC.KeepAlive(data_dir);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 org.ldk.structs.FilesystemStore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FilesystemStore(null, ret); }
26 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
31 * Returns the data directory.
33 public string get_data_dir() {
34 long ret = bindings.FilesystemStore_get_data_dir(this.ptr);
36 if (ret >= 0 && ret <= 4096) { return null; }
37 string ret_conv = InternalUtils.decodeString(ret);
42 * Constructs a new KVStore which calls the relevant methods on this_arg.
43 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
45 public KVStore as_KVStore() {
46 long ret = bindings.FilesystemStore_as_KVStore(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 KVStore ret_hu_conv = new KVStore(null, ret);
50 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };