Skip to main content

engage/generated/moon_sharp/interpreter/interop/converters/
stringconversions.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::{
9        object::{IObject, Object},
10        r#enum::{Enum, IEnum},
11        valuetype::{IValueType, ValueType},
12    };
13
14    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/interop/converters/stringconversions/StringConversions_StringSubtype.md"))]
15    #[repr(C)]
16    #[derive(::core::clone::Clone, ::core::marker::Copy, ::core::fmt::Debug, ::core::cmp::PartialEq, ::core::cmp::Eq)]
17    pub struct StringConversions_StringSubtype {
18        pub value: i32,
19    }
20    impl ::unity::ClassIdentity for StringConversions_StringSubtype {
21        const NAME: &'static str = "StringConversions.StringSubtype";
22        const NAMESPACE: &'static str = "MoonSharp.Interpreter.Interop.Converters";
23
24        fn class() -> ::unity::Class {
25            static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
26            *CACHE.get_or_init(|| ::unity::Class::lookup(Self::NAMESPACE, Self::NAME))
27        }
28    }
29    impl ::unity::IlType for StringConversions_StringSubtype {
30        fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
31            &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
32        }
33    }
34    impl StringConversions_StringSubtype {
35        pub fn none() -> Self {
36            Self { value: 0 }
37        }
38
39        pub fn string() -> Self {
40            Self { value: 1 }
41        }
42
43        pub fn string_builder() -> Self {
44            Self { value: 2 }
45        }
46
47        pub fn char() -> Self {
48            Self { value: 3 }
49        }
50    }
51
52    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/interop/converters/stringconversions/StringConversions.md"))]
53    #[::unity::class(namespace = "MoonSharp.Interpreter.Interop.Converters", name = "StringConversions")]
54    #[parent(crate::system::object::Object)]
55    pub struct StringConversions {}
56}
57
58#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions-types")]
59pub use __types::*;
60
61#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions")]
62#[doc(hidden)]
63#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
64mod __StringConversions_unity_raw {
65    use super::*;
66    #[doc(hidden)]
67    #[allow(non_snake_case)]
68    pub mod __lookup_get_string_subtype {
69        use super::*;
70        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
71            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::SystemType as ::unity::IlType>::il_type()];
72            ::unity::lookup::method_info_on_class_with_signature(
73                <StringConversions as ::unity::ClassIdentity>::class(),
74                "GetStringSubtype",
75                1,
76                param_types,
77                true,
78            )
79        });
80        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
81            match &*METHOD {
82                ::core::result::Result::Ok(mi) => *mi,
83                ::core::result::Result::Err(e) => {
84                    panic!(
85                        "method lookup failed: {}
86::{}
87: {}
88",
89                        <StringConversions as ::unity::ClassIdentity>::NAME,
90                        "GetStringSubtype",
91                        e
92                    )
93                },
94            }
95        }
96    }
97    #[doc(hidden)]
98    #[allow(non_snake_case)]
99    pub mod __lookup_convert_string {
100        use super::*;
101        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
102            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
103                <crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype as ::unity::IlType>::il_type(
104                ),
105                <::unity::Il2CppString as ::unity::IlType>::il_type(),
106                <::unity::SystemType as ::unity::IlType>::il_type(),
107                <crate::moon_sharp::interpreter::datatype::DataType as ::unity::IlType>::il_type(),
108            ];
109            ::unity::lookup::method_info_on_class_with_signature(
110                <StringConversions as ::unity::ClassIdentity>::class(),
111                "ConvertString",
112                4,
113                param_types,
114                true,
115            )
116        });
117        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
118            match &*METHOD {
119                ::core::result::Result::Ok(mi) => *mi,
120                ::core::result::Result::Err(e) => {
121                    panic!(
122                        "method lookup failed: {}
123::{}
124: {}
125",
126                        <StringConversions as ::unity::ClassIdentity>::NAME,
127                        "ConvertString",
128                        e
129                    )
130                },
131            }
132        }
133    }
134}
135
136#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions")]
137impl StringConversions {
138    #[doc = "`GetStringSubtype(::unity::SystemType)` overload"]
139    pub fn get_string_subtype(
140        desired_type: impl ::core::convert::Into<::unity::SystemType>,
141    ) -> crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype {
142        unsafe {
143            ::unity::il2cpp_call!(__StringConversions_unity_raw::__lookup_get_string_subtype::get_method_info().method_ptr,crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype;
144(::unity::SystemType)::core::convert::Into::into(desired_type))
145        }
146    }
147
148    #[doc = "`ConvertString(crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype, ::unity::Il2CppString, ::unity::SystemType, crate::moon_sharp::interpreter::datatype::DataType)` overload"]
149    pub fn convert_string(
150        string_sub_type: impl ::core::convert::Into<
151            crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype,
152        >,
153        str: impl ::core::convert::Into<::unity::Il2CppString>,
154        desired_type: impl ::core::convert::Into<::unity::SystemType>,
155        data_type: impl ::core::convert::Into<crate::moon_sharp::interpreter::datatype::DataType>,
156    ) -> crate::system::object::Object {
157        unsafe {
158            ::unity::il2cpp_call!(__StringConversions_unity_raw::__lookup_convert_string::get_method_info().method_ptr,crate::system::object::Object;
159(crate::moon_sharp::interpreter::interop::converters::stringconversions::StringConversions_StringSubtype)::core::convert::Into::into(string_sub_type),(::unity::Il2CppString)::core::convert::Into::into(str),(::unity::SystemType)::core::convert::Into::into(desired_type),(crate::moon_sharp::interpreter::datatype::DataType)::core::convert::Into::into(data_type))
160        }
161    }
162}
163
164#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions")]
165impl StringConversions {
166    pub fn get_string_subtype_method_info() -> &'static ::unity::il2cpp::MethodInfo {
167        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
168    }
169
170    pub fn convert_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
171        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
172    }
173}
174
175#[cfg(feature = "moon_sharp-interpreter-interop-converters-stringconversions")]
176#[doc(hidden)]
177pub mod prelude {
178    pub use super::{IStringConversions, StringConversions, StringConversions_StringSubtype};
179    #[cfg(feature = "system-object")]
180    pub use crate::system::object::IObjectMethods;
181    #[cfg(feature = "system-enum")]
182    pub use crate::system::r#enum::IEnumMethods;
183    #[cfg(feature = "system-valuetype")]
184    pub use crate::system::valuetype::IValueTypeMethods;
185    pub use crate::system::{object::IObject, r#enum::IEnum, valuetype::IValueType};
186}