Remove or make private FileAccess close() methods.

This commit is contained in:
bruvzg 2022-04-12 11:15:02 +03:00
parent 788f355ad2
commit d2ebac3a30
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
21 changed files with 44 additions and 74 deletions

View file

@ -71,10 +71,7 @@ void FileAccessUnix::check_errors() const {
}
Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
if (f) {
fclose(f);
}
f = nullptr;
_close();
path_src = p_path;
path = fix_path(p_path);
@ -148,7 +145,7 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
return OK;
}
void FileAccessUnix::close() {
void FileAccessUnix::_close() {
if (!f) {
return;
}
@ -343,7 +340,7 @@ Ref<FileAccess> FileAccessUnix::create_libc() {
CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr;
FileAccessUnix::~FileAccessUnix() {
close();
_close();
}
#endif

View file

@ -50,12 +50,12 @@ class FileAccessUnix : public FileAccess {
String path_src;
static Ref<FileAccess> create_libc();
void _close();
public:
static CloseNotificationFunc close_notification_func;
virtual Error _open(const String &p_path, int p_mode_flags); ///< open a file
virtual void close(); ///< close a file
virtual bool is_open() const; ///< true when file is open
virtual String get_path() const; /// returns the path for the current open file