summaryrefslogtreecommitdiff
path: root/core/os/dir_access.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/dir_access.h')
-rw-r--r--core/os/dir_access.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index 6c876cde5a..cac0d0ec7c 100644
--- a/core/os/dir_access.h
+++ b/core/os/dir_access.h
@@ -47,7 +47,7 @@ public:
typedef DirAccess *(*CreateFunc)();
private:
- AccessType _access_type;
+ AccessType _access_type = ACCESS_FILESYSTEM;
static CreateFunc create_func[ACCESS_MAX]; ///< set this to instance a filesystem object
Error _copy_dir(DirAccess *p_target_da, String p_to, int p_chmod_flags);
@@ -110,16 +110,6 @@ public:
static String get_full_path(const String &p_path, AccessType p_access);
static DirAccess *create_for_path(const String &p_path);
- /*
- enum DirType {
-
- FILE_TYPE_INVALID,
- FILE_TYPE_FILE,
- FILE_TYPE_DIR,
- };
-
- //virtual DirType get_file_type() const=0;
-*/
static DirAccess *create(AccessType p_access);
template <class T>
@@ -130,8 +120,8 @@ public:
static DirAccess *open(const String &p_path, Error *r_error = nullptr);
- DirAccess();
- virtual ~DirAccess();
+ DirAccess() {}
+ virtual ~DirAccess() {}
};
struct DirAccessRef {
@@ -142,7 +132,9 @@ struct DirAccessRef {
}
operator bool() const { return f != nullptr; }
+
DirAccess *f;
+
DirAccessRef(DirAccess *fa) { f = fa; }
~DirAccessRef() {
if (f)