summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-03-23 11:08:58 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-04-11 13:28:51 +0300
commit9381acb6a42da653cb6dfd9e610dfccead11aa98 (patch)
tree7c781fabd1f496345ca73cc362a5f88060af0fde /drivers/unix
parentca9372622f331f26daf38086a31c4eeea768e540 (diff)
Make FileAccess and DirAccess classes reference counted.
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/dir_access_unix.cpp4
-rw-r--r--drivers/unix/dir_access_unix.h4
-rw-r--r--drivers/unix/file_access_unix.cpp2
-rw-r--r--drivers/unix/file_access_unix.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index af47173b41..7e6105f033 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -49,7 +49,7 @@
#include <mntent.h>
#endif
-DirAccess *DirAccessUnix::create_fs() {
+Ref<DirAccess> DirAccessUnix::create_fs() {
return memnew(DirAccessUnix);
}
@@ -374,7 +374,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
return OK;
}
-String DirAccessUnix::get_current_dir(bool p_include_drive) {
+String DirAccessUnix::get_current_dir(bool p_include_drive) const {
String base = _get_root_path();
if (!base.is_empty()) {
String bd = current_dir.replace_first(base, "");
diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h
index b4dc012db2..4fea7cd154 100644
--- a/drivers/unix/dir_access_unix.h
+++ b/drivers/unix/dir_access_unix.h
@@ -43,7 +43,7 @@
class DirAccessUnix : public DirAccess {
DIR *dir_stream = nullptr;
- static DirAccess *create_fs();
+ static Ref<DirAccess> create_fs();
String current_dir;
bool _cisdir;
@@ -67,7 +67,7 @@ public:
virtual bool drives_are_shortcuts();
virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success
- virtual String get_current_dir(bool p_include_drive = true); ///< return current dir location
+ virtual String get_current_dir(bool p_include_drive = true) const; ///< return current dir location
virtual Error make_dir(String p_dir);
virtual bool file_exists(String p_file);
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index ea442ad8bf..99da292e12 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -336,7 +336,7 @@ Error FileAccessUnix::_set_unix_permissions(const String &p_file, uint32_t p_per
return FAILED;
}
-FileAccess *FileAccessUnix::create_libc() {
+Ref<FileAccess> FileAccessUnix::create_libc() {
return memnew(FileAccessUnix);
}
diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h
index 8ebdcd2a2d..692776915c 100644
--- a/drivers/unix/file_access_unix.h
+++ b/drivers/unix/file_access_unix.h
@@ -49,7 +49,7 @@ class FileAccessUnix : public FileAccess {
String path;
String path_src;
- static FileAccess *create_libc();
+ static Ref<FileAccess> create_libc();
public:
static CloseNotificationFunc close_notification_func;