CSharp: fix LDKStr array decoding
[ldk-java] / c_sharp / src / org / ldk / structs / Result_NoneNoneZ.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 public class Result_NoneNoneZ : CommonBase {
9         Result_NoneNoneZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_NoneNoneZ() {
11                 if (ptr != 0) { bindings.CResult_NoneNoneZ_free(ptr); }
12         }
13
14         internal static Result_NoneNoneZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_NoneNoneZ_is_ok(ptr)) {
16                         return new Result_NoneNoneZ_OK(null, ptr);
17                 } else {
18                         return new Result_NoneNoneZ_Err(null, ptr);
19                 }
20         }
21         public class Result_NoneNoneZ_OK : Result_NoneNoneZ {
22                 internal Result_NoneNoneZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
23                 }
24         }
25
26         public class Result_NoneNoneZ_Err : Result_NoneNoneZ {
27                 internal Result_NoneNoneZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
28                 }
29         }
30
31         /**
32          * Creates a new CResult_NoneNoneZ in the success state.
33          */
34         public static Result_NoneNoneZ ok() {
35                 long ret = bindings.CResult_NoneNoneZ_ok();
36                 if (ret >= 0 && ret <= 4096) { return null; }
37                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
38                 return ret_hu_conv;
39         }
40
41         /**
42          * Creates a new CResult_NoneNoneZ in the error state.
43          */
44         public static Result_NoneNoneZ err() {
45                 long ret = bindings.CResult_NoneNoneZ_err();
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
48                 return ret_hu_conv;
49         }
50
51         /**
52          * Checks if the given object is currently in the success state
53          */
54         public bool is_ok() {
55                 bool ret = bindings.CResult_NoneNoneZ_is_ok(this.ptr);
56                 GC.KeepAlive(this);
57                 return ret;
58         }
59
60         internal long clone_ptr() {
61                 long ret = bindings.CResult_NoneNoneZ_clone_ptr(this.ptr);
62                 GC.KeepAlive(this);
63                 return ret;
64         }
65
66         /**
67          * Creates a new CResult_NoneNoneZ which has the same data as `orig`
68          * but with all dynamically-allocated buffers duplicated in new buffers.
69          */
70         public Result_NoneNoneZ clone() {
71                 long ret = bindings.CResult_NoneNoneZ_clone(this.ptr);
72                 GC.KeepAlive(this);
73                 if (ret >= 0 && ret <= 4096) { return null; }
74                 Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
75                 return ret_hu_conv;
76         }
77
78 }
79 } } }