[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / FilesystemStore.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A [`KVStore`] implementation that writes to and reads from the file system.
11  */
12 public class FilesystemStore : CommonBase {
13         internal FilesystemStore(object _dummy, long ptr) : base(ptr) { }
14         ~FilesystemStore() {
15                 if (ptr != 0) { bindings.FilesystemStore_free(ptr); }
16         }
17
18         /**
19          * Constructs a new [`FilesystemStore`].
20          */
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); };
27                 return ret_hu_conv;
28         }
29
30         /**
31          * Returns the data directory.
32          */
33         public string get_data_dir() {
34                 long ret = bindings.FilesystemStore_get_data_dir(this.ptr);
35                 GC.KeepAlive(this);
36                 if (ret >= 0 && ret <= 4096) { return null; }
37                 string ret_conv = InternalUtils.decodeString(ret);
38                 return ret_conv;
39         }
40
41         /**
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
44          */
45         public KVStore as_KVStore() {
46                 long ret = bindings.FilesystemStore_as_KVStore(this.ptr);
47                 GC.KeepAlive(this);
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); };
51                 return ret_hu_conv;
52         }
53
54 }
55 } } }