-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
bdecode_node.java
209 lines (163 loc) · 6.75 KB
/
bdecode_node.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.frostwire.jlibtorrent.swig;
public class bdecode_node {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected bdecode_node(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(bdecode_node obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
libtorrent_jni.delete_bdecode_node(swigCPtr);
}
swigCPtr = 0;
}
}
public bdecode_node() {
this(libtorrent_jni.new_bdecode_node__SWIG_0(), true);
}
public bdecode_node(bdecode_node arg0) {
this(libtorrent_jni.new_bdecode_node__SWIG_1(bdecode_node.getCPtr(arg0), arg0), true);
}
public bdecode_node.type_t type() {
return bdecode_node.type_t.swigToEnum(libtorrent_jni.bdecode_node_type(swigCPtr, this));
}
public boolean op_bool() {
return libtorrent_jni.bdecode_node_op_bool(swigCPtr, this);
}
public bdecode_node non_owning() {
return new bdecode_node(libtorrent_jni.bdecode_node_non_owning(swigCPtr, this), true);
}
public char_const_ptr_int_pair data_section() {
return new char_const_ptr_int_pair(libtorrent_jni.bdecode_node_data_section(swigCPtr, this), true);
}
public String list_string_value_at(int i, String default_val) {
return libtorrent_jni.bdecode_node_list_string_value_at__SWIG_0(swigCPtr, this, i, default_val);
}
public String list_string_value_at(int i) {
return libtorrent_jni.bdecode_node_list_string_value_at__SWIG_1(swigCPtr, this, i);
}
public long list_int_value_at(int i, long default_val) {
return libtorrent_jni.bdecode_node_list_int_value_at__SWIG_0(swigCPtr, this, i, default_val);
}
public long list_int_value_at(int i) {
return libtorrent_jni.bdecode_node_list_int_value_at__SWIG_1(swigCPtr, this, i);
}
public int list_size() {
return libtorrent_jni.bdecode_node_list_size(swigCPtr, this);
}
public bdecode_node dict_find(String key) {
return new bdecode_node(libtorrent_jni.bdecode_node_dict_find(swigCPtr, this, key), true);
}
public string_bdecode_node_pair dict_at(int i) {
return new string_bdecode_node_pair(libtorrent_jni.bdecode_node_dict_at(swigCPtr, this, i), true);
}
public bdecode_node dict_find_dict(String key) {
return new bdecode_node(libtorrent_jni.bdecode_node_dict_find_dict(swigCPtr, this, key), true);
}
public bdecode_node dict_find_list(String key) {
return new bdecode_node(libtorrent_jni.bdecode_node_dict_find_list(swigCPtr, this, key), true);
}
public bdecode_node dict_find_string(String key) {
return new bdecode_node(libtorrent_jni.bdecode_node_dict_find_string(swigCPtr, this, key), true);
}
public bdecode_node dict_find_int(String key) {
return new bdecode_node(libtorrent_jni.bdecode_node_dict_find_int(swigCPtr, this, key), true);
}
public String dict_find_string_value(String key, String default_value) {
return libtorrent_jni.bdecode_node_dict_find_string_value__SWIG_0(swigCPtr, this, key, default_value);
}
public String dict_find_string_value(String key) {
return libtorrent_jni.bdecode_node_dict_find_string_value__SWIG_1(swigCPtr, this, key);
}
public long dict_find_int_value(String key, long default_val) {
return libtorrent_jni.bdecode_node_dict_find_int_value__SWIG_0(swigCPtr, this, key, default_val);
}
public long dict_find_int_value(String key) {
return libtorrent_jni.bdecode_node_dict_find_int_value__SWIG_1(swigCPtr, this, key);
}
public int dict_size() {
return libtorrent_jni.bdecode_node_dict_size(swigCPtr, this);
}
public long int_value() {
return libtorrent_jni.bdecode_node_int_value(swigCPtr, this);
}
public String string_value() {
return libtorrent_jni.bdecode_node_string_value(swigCPtr, this);
}
public String string_ptr() {
return libtorrent_jni.bdecode_node_string_ptr(swigCPtr, this);
}
public int string_length() {
return libtorrent_jni.bdecode_node_string_length(swigCPtr, this);
}
public void clear() {
libtorrent_jni.bdecode_node_clear(swigCPtr, this);
}
public void swap(bdecode_node n) {
libtorrent_jni.bdecode_node_swap(swigCPtr, this, bdecode_node.getCPtr(n), n);
}
public void reserve(int tokens) {
libtorrent_jni.bdecode_node_reserve(swigCPtr, this, tokens);
}
public void switch_underlying_buffer(String buf) {
libtorrent_jni.bdecode_node_switch_underlying_buffer(swigCPtr, this, buf);
}
public static int bdecode(char_vector buffer, bdecode_node ret, error_code ec) {
return libtorrent_jni.bdecode_node_bdecode(char_vector.getCPtr(buffer), buffer, bdecode_node.getCPtr(ret), ret, error_code.getCPtr(ec), ec);
}
public final static class type_t {
public final static bdecode_node.type_t none_t = new bdecode_node.type_t("none_t");
public final static bdecode_node.type_t dict_t = new bdecode_node.type_t("dict_t");
public final static bdecode_node.type_t list_t = new bdecode_node.type_t("list_t");
public final static bdecode_node.type_t string_t = new bdecode_node.type_t("string_t");
public final static bdecode_node.type_t int_t = new bdecode_node.type_t("int_t");
public final int swigValue() {
return swigValue;
}
public String toString() {
return swigName;
}
public static type_t swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];
throw new IllegalArgumentException("No enum " + type_t.class + " with value " + swigValue);
}
private type_t(String swigName) {
this.swigName = swigName;
this.swigValue = swigNext++;
}
private type_t(String swigName, int swigValue) {
this.swigName = swigName;
this.swigValue = swigValue;
swigNext = swigValue+1;
}
private type_t(String swigName, type_t swigEnum) {
this.swigName = swigName;
this.swigValue = swigEnum.swigValue;
swigNext = this.swigValue+1;
}
private static type_t[] swigValues = { none_t, dict_t, list_t, string_t, int_t };
private static int swigNext = 0;
private final int swigValue;
private final String swigName;
}
}