engage/generated/system/io/
stringreader.rs1#[cfg(feature = "system-io-stringreader-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 io::textreader::{ITextReader, TextReader},
10 object::{IObject, Object},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/io/stringreader/StringReader.md"))]
14 #[::unity::class(namespace = "System.IO", name = "StringReader")]
15 #[parent(crate::system::io::textreader::TextReader)]
16 pub struct StringReader {
17 #[offset(24)]
18 #[rename(name = "_s")]
19 pub s: ::unity::Il2CppString,
20 #[offset(32)]
21 #[rename(name = "_pos")]
22 pub pos: i32,
23 #[offset(36)]
24 #[rename(name = "_length")]
25 pub length: i32,
26 }
27}
28
29#[cfg(feature = "system-io-stringreader-types")]
30pub use __types::*;
31
32#[cfg(feature = "system-io-stringreader")]
33pub trait IStringReaderMethods: IStringReader {
34 #[doc = "`.ctor(::unity::Il2CppString)` overload"]
35 fn ctor(self, s: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
36 unsafe {
37 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
38 ::unity::il2cpp_call!((::unity::module_base()+0x358bb40usize)as*mut u8,();
39(StringReader)__receiver,(::unity::Il2CppString)::core::convert::Into::into(s))
40 }
41 }
42 #[doc = "`Close()` overload"]
43 fn close(self) -> () {
44 unsafe {
45 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
46 {
47 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
48 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
49 panic!(
50 "unity: virtual slot {}
51 out of range (vtable len {}
52) on the runtime class behind {}
53 (method `{}
54`)",
55 7usize,
56 __vt.len(),
57 <StringReader as ::unity::ClassIdentity>::NAME,
58 "Close",
59 )
60 });
61 let __inner: extern "C" fn(StringReader, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
62 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
63 __inner(__receiver, __mi)
64 }
65 }
66 }
67 #[doc = "`Dispose(bool)` overload"]
68 fn dispose(self, disposing: impl ::core::convert::Into<bool>) -> () {
69 unsafe {
70 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
71 {
72 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
73 let __vi = *__vt.get(8usize).unwrap_or_else(|| {
74 panic!(
75 "unity: virtual slot {}
76 out of range (vtable len {}
77) on the runtime class behind {}
78 (method `{}
79`)",
80 8usize,
81 __vt.len(),
82 <StringReader as ::unity::ClassIdentity>::NAME,
83 "Dispose",
84 )
85 });
86 let __inner: extern "C" fn(StringReader, bool, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
87 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
88 __inner(__receiver, ::core::convert::Into::into(disposing), __mi)
89 }
90 }
91 }
92 #[doc = "`Peek()` overload"]
93 fn peek(self) -> i32 {
94 unsafe {
95 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
96 {
97 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
98 let __vi = *__vt.get(9usize).unwrap_or_else(|| {
99 panic!(
100 "unity: virtual slot {}
101 out of range (vtable len {}
102) on the runtime class behind {}
103 (method `{}
104`)",
105 9usize,
106 __vt.len(),
107 <StringReader as ::unity::ClassIdentity>::NAME,
108 "Peek",
109 )
110 });
111 let __inner: extern "C" fn(StringReader, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__vi.method_ptr);
112 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
113 __inner(__receiver, __mi)
114 }
115 }
116 }
117 #[doc = "`Read()` overload"]
118 fn read(self) -> i32 {
119 unsafe {
120 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
121 {
122 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
123 let __vi = *__vt.get(10usize).unwrap_or_else(|| {
124 panic!(
125 "unity: virtual slot {}
126 out of range (vtable len {}
127) on the runtime class behind {}
128 (method `{}
129`)",
130 10usize,
131 __vt.len(),
132 <StringReader as ::unity::ClassIdentity>::NAME,
133 "Read",
134 )
135 });
136 let __inner: extern "C" fn(StringReader, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__vi.method_ptr);
137 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
138 __inner(__receiver, __mi)
139 }
140 }
141 }
142 #[doc = "`Read(::unity::Array<u16>, i32, i32)` overload"]
143 fn read_2(
144 self,
145 buffer: impl ::core::convert::Into<::unity::Array<u16>>,
146 index: impl ::core::convert::Into<i32>,
147 count: impl ::core::convert::Into<i32>,
148 ) -> i32 {
149 unsafe {
150 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
151 {
152 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
153 let __vi = *__vt.get(11usize).unwrap_or_else(|| {
154 panic!(
155 "unity: virtual slot {}
156 out of range (vtable len {}
157) on the runtime class behind {}
158 (method `{}
159`)",
160 11usize,
161 __vt.len(),
162 <StringReader as ::unity::ClassIdentity>::NAME,
163 "Read",
164 )
165 });
166 let __inner: extern "C" fn(StringReader, ::unity::Array<u16>, i32, i32, ::unity::OptionalMethod) -> i32 =
167 ::core::mem::transmute(__vi.method_ptr);
168 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
169 __inner(
170 __receiver,
171 ::core::convert::Into::into(buffer),
172 ::core::convert::Into::into(index),
173 ::core::convert::Into::into(count),
174 __mi,
175 )
176 }
177 }
178 }
179 #[doc = "`ReadToEnd()` overload"]
180 fn read_to_end(self) -> ::unity::Il2CppString {
181 unsafe {
182 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
183 {
184 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
185 let __vi = *__vt.get(12usize).unwrap_or_else(|| {
186 panic!(
187 "unity: virtual slot {}
188 out of range (vtable len {}
189) on the runtime class behind {}
190 (method `{}
191`)",
192 12usize,
193 __vt.len(),
194 <StringReader as ::unity::ClassIdentity>::NAME,
195 "ReadToEnd",
196 )
197 });
198 let __inner: extern "C" fn(StringReader, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
199 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
200 __inner(__receiver, __mi)
201 }
202 }
203 }
204 #[doc = "`ReadLine()` overload"]
205 fn read_line(self) -> ::unity::Il2CppString {
206 unsafe {
207 let __receiver = <StringReader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
208 {
209 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
210 let __vi = *__vt.get(14usize).unwrap_or_else(|| {
211 panic!(
212 "unity: virtual slot {}
213 out of range (vtable len {}
214) on the runtime class behind {}
215 (method `{}
216`)",
217 14usize,
218 __vt.len(),
219 <StringReader as ::unity::ClassIdentity>::NAME,
220 "ReadLine",
221 )
222 });
223 let __inner: extern "C" fn(StringReader, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
224 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
225 __inner(__receiver, __mi)
226 }
227 }
228 }
229}
230
231#[cfg(feature = "system-io-stringreader")]
232impl<__T: IStringReader> IStringReaderMethods for __T {}
233
234#[cfg(feature = "system-io-stringreader")]
235impl StringReader {
236 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
237 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
238 }
239
240 pub fn close_method_info() -> &'static ::unity::il2cpp::MethodInfo {
241 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
242 }
243
244 pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
245 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
246 }
247
248 pub fn peek_method_info() -> &'static ::unity::il2cpp::MethodInfo {
249 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
250 }
251
252 pub fn read_method_info() -> &'static ::unity::il2cpp::MethodInfo {
253 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
254 }
255
256 pub fn read_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
257 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
258 }
259
260 pub fn read_to_end_method_info() -> &'static ::unity::il2cpp::MethodInfo {
261 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
262 }
263
264 pub fn read_line_method_info() -> &'static ::unity::il2cpp::MethodInfo {
265 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
266 }
267}
268
269#[cfg(feature = "system-io-stringreader")]
270impl StringReader {
271 #[doc = "Direct (non-virtual) call to `StringReader`'s own `Close`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
272 pub unsafe fn close(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
273 let __mi = Self::close_method_info();
274 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
275 __inner(this.into(), ::core::option::Option::None)
276 }
277
278 #[doc = "Direct (non-virtual) call to `StringReader`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
279 pub unsafe fn dispose(this: impl ::core::convert::Into<::unity::IlInstance>, disposing: bool) -> () {
280 let __mi = Self::dispose_method_info();
281 let __inner: extern "C" fn(::unity::IlInstance, bool, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
282 __inner(this.into(), disposing, ::core::option::Option::None)
283 }
284
285 #[doc = "Direct (non-virtual) call to `StringReader`'s own `Peek`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
286 pub unsafe fn peek(this: impl ::core::convert::Into<::unity::IlInstance>) -> i32 {
287 let __mi = Self::peek_method_info();
288 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__mi.method_ptr);
289 __inner(this.into(), ::core::option::Option::None)
290 }
291
292 #[doc = "Direct (non-virtual) call to `StringReader`'s own `Read`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
293 pub unsafe fn read(this: impl ::core::convert::Into<::unity::IlInstance>) -> i32 {
294 let __mi = Self::read_method_info();
295 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__mi.method_ptr);
296 __inner(this.into(), ::core::option::Option::None)
297 }
298
299 #[doc = "Direct (non-virtual) call to `StringReader`'s own `Read`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
300 pub unsafe fn read_2(this: impl ::core::convert::Into<::unity::IlInstance>, buffer: ::unity::Array<u16>, index: i32, count: i32) -> i32 {
301 let __mi = Self::read_2_method_info();
302 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Array<u16>, i32, i32, ::unity::OptionalMethod) -> i32 =
303 ::core::mem::transmute(__mi.method_ptr);
304 __inner(this.into(), buffer, index, count, ::core::option::Option::None)
305 }
306
307 #[doc = "Direct (non-virtual) call to `StringReader`'s own `ReadToEnd`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
308 pub unsafe fn read_to_end(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
309 let __mi = Self::read_to_end_method_info();
310 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
311 __inner(this.into(), ::core::option::Option::None)
312 }
313
314 #[doc = "Direct (non-virtual) call to `StringReader`'s own `ReadLine`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
315 pub unsafe fn read_line(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
316 let __mi = Self::read_line_method_info();
317 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
318 __inner(this.into(), ::core::option::Option::None)
319 }
320}
321
322#[cfg(feature = "system-io-stringreader")]
323impl StringReader {
324 #[doc = "`.ctor(::unity::Il2CppString)` — overload selector"]
325 pub fn new(s: ::unity::Il2CppString) -> Self {
326 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
327 panic!(
328 "{}
329::{}
330 failed to instantiate",
331 ::core::stringify!(StringReader),
332 ::core::stringify!(new),
333 )
334 });
335 <Self as IStringReaderMethods>::ctor(this, s);
336 this
337 }
338}
339
340#[cfg(feature = "system-io-stringreader")]
341#[doc(hidden)]
342pub mod prelude {
343 pub use super::{IStringReader, IStringReaderMethods, StringReader};
344 #[cfg(feature = "system-io-textreader")]
345 pub use crate::system::io::textreader::ITextReaderMethods;
346 #[cfg(feature = "system-object")]
347 pub use crate::system::object::IObjectMethods;
348 pub use crate::system::{io::textreader::ITextReader, object::IObject};
349}