engage/generated/system/io/
file.rs1#[cfg(feature = "system-io-file-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::object::{IObject, Object};
9
10 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/io/file/File.md"))]
11 #[::unity::class(namespace = "System.IO", name = "File")]
12 #[parent(crate::system::object::Object)]
13 pub struct File {
14 #[static_field]
15 #[rename(name = "defaultLocalFileTime")]
16 pub default_local_file_time: ::unity::IlInstance,
17 }
18}
19
20#[cfg(feature = "system-io-file-types")]
21pub use __types::*;
22
23#[cfg(feature = "system-io-file")]
24impl File {
25 #[doc = "`Create(::unity::Il2CppString)` overload"]
26 pub fn create(path: impl ::core::convert::Into<::unity::Il2CppString>) -> crate::system::io::filestream::FileStream {
27 unsafe {
28 ::unity::il2cpp_call!((::unity::module_base()+0x380ae60usize)as*mut u8,crate::system::io::filestream::FileStream;
29(::unity::Il2CppString)::core::convert::Into::into(path))
30 }
31 }
32
33 #[doc = "`Create(::unity::Il2CppString, i32)` overload"]
34 pub fn create_2(
35 path: impl ::core::convert::Into<::unity::Il2CppString>,
36 buffer_size: impl ::core::convert::Into<i32>,
37 ) -> crate::system::io::filestream::FileStream {
38 unsafe {
39 ::unity::il2cpp_call!((::unity::module_base()+0x380aef0usize)as*mut u8,crate::system::io::filestream::FileStream;
40(::unity::Il2CppString)::core::convert::Into::into(path),(i32)::core::convert::Into::into(buffer_size))
41 }
42 }
43
44 #[doc = "`Delete(::unity::Il2CppString)` overload"]
45 pub fn delete(path: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
46 unsafe {
47 ::unity::il2cpp_call!((::unity::module_base()+0x380afb0usize)as*mut u8,();
48(::unity::Il2CppString)::core::convert::Into::into(path))
49 }
50 }
51
52 #[doc = "`Exists(::unity::Il2CppString)` overload"]
53 pub fn exists(path: impl ::core::convert::Into<::unity::Il2CppString>) -> bool {
54 unsafe {
55 ::unity::il2cpp_call!((::unity::module_base()+0x380b250usize)as*mut u8,bool;
56(::unity::Il2CppString)::core::convert::Into::into(path))
57 }
58 }
59
60 #[doc = "`Move(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
61 pub fn r#move(
62 source_file_name: impl ::core::convert::Into<::unity::Il2CppString>,
63 dest_file_name: impl ::core::convert::Into<::unity::Il2CppString>,
64 ) -> () {
65 unsafe {
66 ::unity::il2cpp_call!((::unity::module_base()+0x380b5a0usize)as*mut u8,();
67(::unity::Il2CppString)::core::convert::Into::into(source_file_name),(::unity::Il2CppString)::core::convert::Into::into(dest_file_name))
68 }
69 }
70
71 #[doc = "`Open(::unity::Il2CppString, crate::system::io::filemode::FileMode)` overload"]
72 pub fn open(
73 path: impl ::core::convert::Into<::unity::Il2CppString>,
74 mode: impl ::core::convert::Into<crate::system::io::filemode::FileMode>,
75 ) -> crate::system::io::filestream::FileStream {
76 unsafe {
77 ::unity::il2cpp_call!((::unity::module_base()+0x380baa0usize)as*mut u8,crate::system::io::filestream::FileStream;
78(::unity::Il2CppString)::core::convert::Into::into(path),(crate::system::io::filemode::FileMode)::core::convert::Into::into(mode))
79 }
80 }
81
82 #[doc = "`OpenRead(::unity::Il2CppString)` overload"]
83 pub fn open_read(path: impl ::core::convert::Into<::unity::Il2CppString>) -> crate::system::io::filestream::FileStream {
84 unsafe {
85 ::unity::il2cpp_call!((::unity::module_base()+0x380bb70usize)as*mut u8,crate::system::io::filestream::FileStream;
86(::unity::Il2CppString)::core::convert::Into::into(path))
87 }
88 }
89
90 #[doc = "`OpenText(::unity::Il2CppString)` overload"]
91 pub fn open_text(path: impl ::core::convert::Into<::unity::Il2CppString>) -> crate::system::io::streamreader::StreamReader {
92 unsafe {
93 ::unity::il2cpp_call!((::unity::module_base()+0x380bc00usize)as*mut u8,crate::system::io::streamreader::StreamReader;
94(::unity::Il2CppString)::core::convert::Into::into(path))
95 }
96 }
97
98 #[doc = "`ReadAllBytes(::unity::Il2CppString)` overload"]
99 pub fn read_all_bytes(path: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Array<u8> {
100 unsafe {
101 ::unity::il2cpp_call!((::unity::module_base()+0x380bc70usize)as*mut u8, ::unity::Array<u8> ;
102(::unity::Il2CppString)::core::convert::Into::into(path))
103 }
104 }
105
106 #[doc = "`ReadAllLines(crate::system::io::streamreader::StreamReader)` overload"]
107 pub fn read_all_lines(
108 reader: impl ::core::convert::Into<crate::system::io::streamreader::StreamReader>,
109 ) -> ::unity::Array<::unity::Il2CppString> {
110 unsafe {
111 ::unity::il2cpp_call!((::unity::module_base()+0x380c080usize)as*mut u8, ::unity::Array< ::unity::Il2CppString> ;
112(crate::system::io::streamreader::StreamReader)::core::convert::Into::into(reader))
113 }
114 }
115
116 #[doc = "`ReadAllText(::unity::Il2CppString)` overload"]
117 pub fn read_all_text(path: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
118 unsafe {
119 ::unity::il2cpp_call!((::unity::module_base()+0x380c170usize)as*mut u8, ::unity::Il2CppString;
120(::unity::Il2CppString)::core::convert::Into::into(path))
121 }
122 }
123
124 #[doc = "`WriteAllText(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
125 pub fn write_all_text(
126 path: impl ::core::convert::Into<::unity::Il2CppString>,
127 contents: impl ::core::convert::Into<::unity::Il2CppString>,
128 ) -> () {
129 unsafe {
130 ::unity::il2cpp_call!((::unity::module_base()+0x380c440usize)as*mut u8,();
131(::unity::Il2CppString)::core::convert::Into::into(path),(::unity::Il2CppString)::core::convert::Into::into(contents))
132 }
133 }
134
135 #[doc = "`FillAttributeInfo(::unity::Il2CppString, *mutcrate::system::io::monoiostat::MonoIOStat, bool, bool)` overload"]
136 pub fn fill_attribute_info(
137 path: impl ::core::convert::Into<::unity::Il2CppString>,
138 tryagain: impl ::core::convert::Into<bool>,
139 return_error_on_not_found: impl ::core::convert::Into<bool>,
140 ) -> (i32, crate::system::io::monoiostat::MonoIOStat) {
141 unsafe {
142 let mut __out_0 = ::core::mem::MaybeUninit::<crate::system::io::monoiostat::MonoIOStat>::uninit();
143 let __ret = {
144 ::unity::il2cpp_call!((::unity::module_base()+0x380c630usize)as*mut u8,i32;
145(::unity::Il2CppString)::core::convert::Into::into(path),(*mut crate::system::io::monoiostat::MonoIOStat)__out_0.as_mut_ptr(),(bool)::core::convert::Into::into(tryagain),(bool)::core::convert::Into::into(return_error_on_not_found))
146 };
147 (__ret, __out_0.assume_init())
148 }
149 }
150}
151
152#[cfg(feature = "system-io-file")]
153impl File {
154 pub fn create_method_info() -> &'static ::unity::il2cpp::MethodInfo {
155 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
156 }
157
158 pub fn create_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
159 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
160 }
161
162 pub fn delete_method_info() -> &'static ::unity::il2cpp::MethodInfo {
163 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
164 }
165
166 pub fn exists_method_info() -> &'static ::unity::il2cpp::MethodInfo {
167 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
168 }
169
170 pub fn move_method_info() -> &'static ::unity::il2cpp::MethodInfo {
171 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
172 }
173
174 pub fn open_method_info() -> &'static ::unity::il2cpp::MethodInfo {
175 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
176 }
177
178 pub fn open_read_method_info() -> &'static ::unity::il2cpp::MethodInfo {
179 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
180 }
181
182 pub fn open_text_method_info() -> &'static ::unity::il2cpp::MethodInfo {
183 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
184 }
185
186 pub fn read_all_bytes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
187 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
188 }
189
190 pub fn read_all_lines_method_info() -> &'static ::unity::il2cpp::MethodInfo {
191 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
192 }
193
194 pub fn read_all_text_method_info() -> &'static ::unity::il2cpp::MethodInfo {
195 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
196 }
197
198 pub fn write_all_text_method_info() -> &'static ::unity::il2cpp::MethodInfo {
199 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
200 }
201
202 pub fn fill_attribute_info_method_info() -> &'static ::unity::il2cpp::MethodInfo {
203 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
204 }
205}
206
207#[cfg(feature = "system-io-file")]
208#[doc(hidden)]
209pub mod prelude {
210 pub use super::{File, IFile};
211 pub use crate::system::object::IObject;
212 #[cfg(feature = "system-object")]
213 pub use crate::system::object::IObjectMethods;
214}