1#[cfg(feature = "system-collections-specialized-namevaluecollection-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 collections::specialized::nameobjectcollectionbase::{INameObjectCollectionBase, NameObjectCollectionBase},
10 object::{IObject, Object},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/collections/specialized/namevaluecollection/NameValueCollection.md"))]
14 #[::unity::class(namespace = "System.Collections.Specialized", name = "NameValueCollection")]
15 #[parent(crate::system::collections::specialized::nameobjectcollectionbase::NameObjectCollectionBase)]
16 pub struct NameValueCollection {
17 #[offset(80)]
18 #[rename(name = "_all")]
19 pub all: ::unity::Array<::unity::Il2CppString>,
20 #[offset(88)]
21 #[rename(name = "_allKeys")]
22 pub all_keys: ::unity::Array<::unity::Il2CppString>,
23 }
24}
25
26#[cfg(feature = "system-collections-specialized-namevaluecollection-types")]
27pub use __types::*;
28
29#[cfg(feature = "system-collections-specialized-namevaluecollection")]
30impl NameValueCollection {
31 #[doc = "`GetAsOneString(crate::system::collections::arraylist::ArrayList)` overload"]
32 pub fn get_as_one_string(list: impl ::core::convert::Into<crate::system::collections::arraylist::ArrayList>) -> ::unity::Il2CppString {
33 unsafe {
34 ::unity::il2cpp_call!((::unity::module_base()+0x3487030usize)as*mut u8, ::unity::Il2CppString;
35(crate::system::collections::arraylist::ArrayList)::core::convert::Into::into(list))
36 }
37 }
38
39 #[doc = "`GetAsStringArray(crate::system::collections::arraylist::ArrayList)` overload"]
40 pub fn get_as_string_array(
41 list: impl ::core::convert::Into<crate::system::collections::arraylist::ArrayList>,
42 ) -> ::unity::Array<::unity::Il2CppString> {
43 unsafe {
44 ::unity::il2cpp_call!((::unity::module_base()+0x34871f0usize)as*mut u8, ::unity::Array< ::unity::Il2CppString> ;
45(crate::system::collections::arraylist::ArrayList)::core::convert::Into::into(list))
46 }
47 }
48}
49
50#[cfg(feature = "system-collections-specialized-namevaluecollection")]
51pub trait INameValueCollectionMethods: INameValueCollection {
52 #[doc = "`.ctor()` overload"]
53 fn ctor(self) -> () {
54 unsafe {
55 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
56 ::unity::il2cpp_call!((::unity::module_base()+0x3486e10usize)as*mut u8,();
57(NameValueCollection)__receiver)
58 }
59 }
60 #[doc = "`.ctor(i32, crate::system::collections::iequalitycomparer::IEqualityComparer)` overload"]
61 fn ctor_2(
62 self,
63 capacity: impl ::core::convert::Into<i32>,
64 equality_comparer: impl ::core::convert::Into<crate::system::collections::iequalitycomparer::IEqualityComparer>,
65 ) -> () {
66 unsafe {
67 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
68 ::unity::il2cpp_call!((::unity::module_base()+0x3486e80usize)as*mut u8,();
69(NameValueCollection)__receiver,(i32)::core::convert::Into::into(capacity),(crate::system::collections::iequalitycomparer::IEqualityComparer)::core::convert::Into::into(equality_comparer))
70 }
71 }
72 #[doc = "`InvalidateCachedArrays()` overload"]
73 fn invalidate_cached_arrays(self) -> () {
74 unsafe {
75 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
76 ::unity::il2cpp_call!((::unity::module_base()+0x3486ff0usize)as*mut u8,();
77(NameValueCollection)__receiver)
78 }
79 }
80 #[doc = "`Add(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
81 fn add(self, name: impl ::core::convert::Into<::unity::Il2CppString>, value: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
82 unsafe {
83 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
84 {
85 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
86 let __vi = *__vt.get(15usize).unwrap_or_else(|| {
87 panic!(
88 "unity: virtual slot {}
89 out of range (vtable len {}
90) on the runtime class behind {}
91 (method `{}
92`)",
93 15usize,
94 __vt.len(),
95 <NameValueCollection as ::unity::ClassIdentity>::NAME,
96 "Add",
97 )
98 });
99 let __inner: extern "C" fn(NameValueCollection, ::unity::Il2CppString, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
100 ::core::mem::transmute(__vi.method_ptr);
101 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
102 __inner(__receiver, ::core::convert::Into::into(name), ::core::convert::Into::into(value), __mi)
103 }
104 }
105 }
106 #[doc = "`Get(::unity::Il2CppString)` overload"]
107 fn get(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
108 unsafe {
109 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
110 {
111 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
112 let __vi = *__vt.get(16usize).unwrap_or_else(|| {
113 panic!(
114 "unity: virtual slot {}
115 out of range (vtable len {}
116) on the runtime class behind {}
117 (method `{}
118`)",
119 16usize,
120 __vt.len(),
121 <NameValueCollection as ::unity::ClassIdentity>::NAME,
122 "Get",
123 )
124 });
125 let __inner: extern "C" fn(NameValueCollection, ::unity::Il2CppString, ::unity::OptionalMethod) -> ::unity::Il2CppString =
126 ::core::mem::transmute(__vi.method_ptr);
127 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
128 __inner(__receiver, ::core::convert::Into::into(name), __mi)
129 }
130 }
131 }
132 #[doc = "`GetValues(::unity::Il2CppString)` overload"]
133 fn get_values(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Array<::unity::Il2CppString> {
134 unsafe {
135 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
136 {
137 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
138 let __vi = *__vt.get(17usize).unwrap_or_else(|| {
139 panic!(
140 "unity: virtual slot {}
141 out of range (vtable len {}
142) on the runtime class behind {}
143 (method `{}
144`)",
145 17usize,
146 __vt.len(),
147 <NameValueCollection as ::unity::ClassIdentity>::NAME,
148 "GetValues",
149 )
150 });
151 let __inner: extern "C" fn(
152 NameValueCollection,
153 ::unity::Il2CppString,
154 ::unity::OptionalMethod,
155 ) -> ::unity::Array<::unity::Il2CppString> = ::core::mem::transmute(__vi.method_ptr);
156 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
157 __inner(__receiver, ::core::convert::Into::into(name), __mi)
158 }
159 }
160 }
161 #[doc = "`Set(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
162 fn set(self, name: impl ::core::convert::Into<::unity::Il2CppString>, value: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
163 unsafe {
164 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
165 {
166 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
167 let __vi = *__vt.get(18usize).unwrap_or_else(|| {
168 panic!(
169 "unity: virtual slot {}
170 out of range (vtable len {}
171) on the runtime class behind {}
172 (method `{}
173`)",
174 18usize,
175 __vt.len(),
176 <NameValueCollection as ::unity::ClassIdentity>::NAME,
177 "Set",
178 )
179 });
180 let __inner: extern "C" fn(NameValueCollection, ::unity::Il2CppString, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
181 ::core::mem::transmute(__vi.method_ptr);
182 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
183 __inner(__receiver, ::core::convert::Into::into(name), ::core::convert::Into::into(value), __mi)
184 }
185 }
186 }
187 #[doc = "`Remove(::unity::Il2CppString)` overload"]
188 fn remove(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
189 unsafe {
190 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
191 {
192 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
193 let __vi = *__vt.get(19usize).unwrap_or_else(|| {
194 panic!(
195 "unity: virtual slot {}
196 out of range (vtable len {}
197) on the runtime class behind {}
198 (method `{}
199`)",
200 19usize,
201 __vt.len(),
202 <NameValueCollection as ::unity::ClassIdentity>::NAME,
203 "Remove",
204 )
205 });
206 let __inner: extern "C" fn(NameValueCollection, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
207 ::core::mem::transmute(__vi.method_ptr);
208 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
209 __inner(__receiver, ::core::convert::Into::into(name), __mi)
210 }
211 }
212 }
213 #[doc = "`get_Item(::unity::Il2CppString)` overload"]
214 fn get_item(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
215 unsafe {
216 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
217 ::unity::il2cpp_call!((::unity::module_base()+0x3487920usize)as*mut u8, ::unity::Il2CppString;
218(NameValueCollection)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name))
219 }
220 }
221 #[doc = "`set_Item(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
222 fn set_item(self, name: impl ::core::convert::Into<::unity::Il2CppString>, value: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
223 unsafe {
224 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
225 ::unity::il2cpp_call!((::unity::module_base()+0x3487930usize)as*mut u8,();
226(NameValueCollection)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::Il2CppString)::core::convert::Into::into(value))
227 }
228 }
229 #[doc = "`Get(i32)` overload"]
230 fn get_2(self, index: impl ::core::convert::Into<i32>) -> ::unity::Il2CppString {
231 unsafe {
232 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
233 {
234 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
235 let __vi = *__vt.get(20usize).unwrap_or_else(|| {
236 panic!(
237 "unity: virtual slot {}
238 out of range (vtable len {}
239) on the runtime class behind {}
240 (method `{}
241`)",
242 20usize,
243 __vt.len(),
244 <NameValueCollection as ::unity::ClassIdentity>::NAME,
245 "Get",
246 )
247 });
248 let __inner: extern "C" fn(NameValueCollection, i32, ::unity::OptionalMethod) -> ::unity::Il2CppString =
249 ::core::mem::transmute(__vi.method_ptr);
250 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
251 __inner(__receiver, ::core::convert::Into::into(index), __mi)
252 }
253 }
254 }
255 #[doc = "`GetKey(i32)` overload"]
256 fn get_key(self, index: impl ::core::convert::Into<i32>) -> ::unity::Il2CppString {
257 unsafe {
258 let __receiver = <NameValueCollection as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
259 {
260 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
261 let __vi = *__vt.get(21usize).unwrap_or_else(|| {
262 panic!(
263 "unity: virtual slot {}
264 out of range (vtable len {}
265) on the runtime class behind {}
266 (method `{}
267`)",
268 21usize,
269 __vt.len(),
270 <NameValueCollection as ::unity::ClassIdentity>::NAME,
271 "GetKey",
272 )
273 });
274 let __inner: extern "C" fn(NameValueCollection, i32, ::unity::OptionalMethod) -> ::unity::Il2CppString =
275 ::core::mem::transmute(__vi.method_ptr);
276 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
277 __inner(__receiver, ::core::convert::Into::into(index), __mi)
278 }
279 }
280 }
281}
282
283#[cfg(feature = "system-collections-specialized-namevaluecollection")]
284impl<__T: INameValueCollection> INameValueCollectionMethods for __T {}
285
286#[cfg(feature = "system-collections-specialized-namevaluecollection")]
287impl NameValueCollection {
288 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
289 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
290 }
291
292 pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
293 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
294 }
295
296 pub fn invalidate_cached_arrays_method_info() -> &'static ::unity::il2cpp::MethodInfo {
297 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
298 }
299
300 pub fn get_as_one_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
302 }
303
304 pub fn get_as_string_array_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
306 }
307
308 pub fn add_method_info() -> &'static ::unity::il2cpp::MethodInfo {
309 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
310 }
311
312 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
313 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
314 }
315
316 pub fn get_values_method_info() -> &'static ::unity::il2cpp::MethodInfo {
317 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
318 }
319
320 pub fn set_method_info() -> &'static ::unity::il2cpp::MethodInfo {
321 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
322 }
323
324 pub fn remove_method_info() -> &'static ::unity::il2cpp::MethodInfo {
325 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
326 }
327
328 pub fn get_item_method_info() -> &'static ::unity::il2cpp::MethodInfo {
329 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
330 }
331
332 pub fn set_item_method_info() -> &'static ::unity::il2cpp::MethodInfo {
333 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
334 }
335
336 pub fn get_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
337 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
338 }
339
340 pub fn get_key_method_info() -> &'static ::unity::il2cpp::MethodInfo {
341 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
342 }
343}
344
345#[cfg(feature = "system-collections-specialized-namevaluecollection")]
346impl NameValueCollection {
347 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `Add`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
348 pub unsafe fn add(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString, value: ::unity::Il2CppString) -> () {
349 let __mi = Self::add_method_info();
350 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
351 ::core::mem::transmute(__mi.method_ptr);
352 __inner(this.into(), name, value, ::core::option::Option::None)
353 }
354
355 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `Get`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
356 pub unsafe fn get(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString) -> ::unity::Il2CppString {
357 let __mi = Self::get_method_info();
358 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> ::unity::Il2CppString =
359 ::core::mem::transmute(__mi.method_ptr);
360 __inner(this.into(), name, ::core::option::Option::None)
361 }
362
363 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `GetValues`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
364 pub unsafe fn get_values(
365 this: impl ::core::convert::Into<::unity::IlInstance>,
366 name: ::unity::Il2CppString,
367 ) -> ::unity::Array<::unity::Il2CppString> {
368 let __mi = Self::get_values_method_info();
369 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> ::unity::Array<::unity::Il2CppString> =
370 ::core::mem::transmute(__mi.method_ptr);
371 __inner(this.into(), name, ::core::option::Option::None)
372 }
373
374 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `Set`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
375 pub unsafe fn set(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString, value: ::unity::Il2CppString) -> () {
376 let __mi = Self::set_method_info();
377 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
378 ::core::mem::transmute(__mi.method_ptr);
379 __inner(this.into(), name, value, ::core::option::Option::None)
380 }
381
382 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `Remove`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
383 pub unsafe fn remove(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString) -> () {
384 let __mi = Self::remove_method_info();
385 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> () =
386 ::core::mem::transmute(__mi.method_ptr);
387 __inner(this.into(), name, ::core::option::Option::None)
388 }
389
390 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `Get`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
391 pub unsafe fn get_2(this: impl ::core::convert::Into<::unity::IlInstance>, index: i32) -> ::unity::Il2CppString {
392 let __mi = Self::get_2_method_info();
393 let __inner: extern "C" fn(::unity::IlInstance, i32, ::unity::OptionalMethod) -> ::unity::Il2CppString =
394 ::core::mem::transmute(__mi.method_ptr);
395 __inner(this.into(), index, ::core::option::Option::None)
396 }
397
398 #[doc = "Direct (non-virtual) call to `NameValueCollection`'s own `GetKey`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
399 pub unsafe fn get_key(this: impl ::core::convert::Into<::unity::IlInstance>, index: i32) -> ::unity::Il2CppString {
400 let __mi = Self::get_key_method_info();
401 let __inner: extern "C" fn(::unity::IlInstance, i32, ::unity::OptionalMethod) -> ::unity::Il2CppString =
402 ::core::mem::transmute(__mi.method_ptr);
403 __inner(this.into(), index, ::core::option::Option::None)
404 }
405}
406
407#[cfg(feature = "system-collections-specialized-namevaluecollection")]
408impl NameValueCollection {
409 #[doc = "`.ctor()` — no args"]
410 pub fn new() -> Self {
411 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
412 panic!(
413 "{}
414::{}
415 failed to instantiate",
416 ::core::stringify!(NameValueCollection),
417 ::core::stringify!(new),
418 )
419 });
420 <Self as INameValueCollectionMethods>::ctor(this);
421 this
422 }
423
424 #[doc = "`.ctor(i32, crate::system::collections::iequalitycomparer::IEqualityComparer)` — overload selector"]
425 pub fn new_2(capacity: i32, equality_comparer: crate::system::collections::iequalitycomparer::IEqualityComparer) -> Self {
426 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
427 panic!(
428 "{}
429::{}
430 failed to instantiate",
431 ::core::stringify!(NameValueCollection),
432 ::core::stringify!(new_2),
433 )
434 });
435 <Self as INameValueCollectionMethods>::ctor_2(this, capacity, equality_comparer);
436 this
437 }
438}
439
440#[cfg(feature = "system-collections-specialized-namevaluecollection")]
441#[doc(hidden)]
442pub mod prelude {
443 pub use super::{INameValueCollection, INameValueCollectionMethods, NameValueCollection};
444 #[cfg(feature = "system-collections-specialized-nameobjectcollectionbase")]
445 pub use crate::system::collections::specialized::nameobjectcollectionbase::INameObjectCollectionBaseMethods;
446 #[cfg(feature = "system-object")]
447 pub use crate::system::object::IObjectMethods;
448 pub use crate::system::{collections::specialized::nameobjectcollectionbase::INameObjectCollectionBase, object::IObject};
449}