diff --git a/core/os/dir_access.h b/core/os/dir_access.h index f813e4a86..3475a9f79 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -140,12 +140,18 @@ public: }; struct DirAccessRef { + DirAccess *f; + + _FORCE_INLINE_ bool is_null() const { return f == nullptr; } + _FORCE_INLINE_ bool is_valid() const { return f != nullptr; } + + _FORCE_INLINE_ operator bool() const { return f != nullptr; } + _FORCE_INLINE_ operator DirAccess *() { return f; } + _FORCE_INLINE_ DirAccess *operator->() { return f; } - operator bool() const { return f != nullptr; } - DirAccess *f; DirAccessRef(DirAccess *fa) { f = fa; } DirAccessRef(DirAccessRef &&other) { f = other.f; diff --git a/core/os/file_access.h b/core/os/file_access.h index 39bf6d8ca..42df24c12 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -177,13 +177,18 @@ public: }; struct FileAccessRef { + FileAccess *f; + + _FORCE_INLINE_ bool is_null() const { return f == nullptr; } + _FORCE_INLINE_ bool is_valid() const { return f != nullptr; } + + _FORCE_INLINE_ operator bool() const { return f != nullptr; } + _FORCE_INLINE_ operator FileAccess *() { return f; } + _FORCE_INLINE_ FileAccess *operator->() { return f; } - operator bool() const { return f != nullptr; } - FileAccess *f; - operator FileAccess *() { return f; } FileAccessRef(FileAccess *fa) { f = fa; } FileAccessRef(FileAccessRef &&other) { f = other.f;