File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -223,8 +223,8 @@ class FileAccess : public RefCounted {
223223 static Vector<uint8_t > get_file_as_bytes (const String &p_path, Error *r_error = nullptr );
224224 static String get_file_as_string (const String &p_path, Error *r_error = nullptr );
225225
226- static PackedByteArray _get_file_as_bytes (const String &p_path) { return get_file_as_bytes (p_path); }
227- static String _get_file_as_string (const String &p_path) { return get_file_as_string (p_path); };
226+ static PackedByteArray _get_file_as_bytes (const String &p_path) { return get_file_as_bytes (p_path, &last_file_open_error ); }
227+ static String _get_file_as_string (const String &p_path) { return get_file_as_string (p_path, &last_file_open_error ); }
228228
229229 template <class T >
230230 static void make_default (AccessType p_access) {
Original file line number Diff line number Diff line change 155155 <param index =" 0" name =" path" type =" String" />
156156 <description >
157157 Returns the whole [param path] file contents as a [PackedByteArray] without any decoding.
158+ Returns an empty [PackedByteArray] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred.
158159 </description >
159160 </method >
160161 <method name =" get_file_as_string" qualifiers =" static" >
161162 <return type =" String" />
162163 <param index =" 0" name =" path" type =" String" />
163164 <description >
164165 Returns the whole [param path] file contents as a [String]. Text is interpreted as being UTF-8 encoded.
166+ Returns an empty [String] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred.
165167 </description >
166168 </method >
167169 <method name =" get_float" qualifiers =" const" >
You can’t perform that action at this time.
0 commit comments