From fa02bad17bba3cef7e73e9cdd12399846fb66211 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 19 Jan 2024 23:19:34 +0100 Subject: [PATCH] Also added a non-static open() method to FileAccess. --- sfw/core/file_access.cpp | 4 ++++ sfw/core/file_access.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sfw/core/file_access.cpp b/sfw/core/file_access.cpp index 820cb61..aedb68e 100644 --- a/sfw/core/file_access.cpp +++ b/sfw/core/file_access.cpp @@ -691,6 +691,10 @@ Error FileAccess::reopen(const String &p_path, int p_mode_flags) { return _open(p_path, p_mode_flags); }; +Error FileAccess::open(const String &p_path, int p_mode_flags) { + return _open(p_path, p_mode_flags); +} + FileAccess *FileAccess::create_and_open(const String &p_path, int p_mode_flags, Error *r_error) { //try packed data first diff --git a/sfw/core/file_access.h b/sfw/core/file_access.h index 8e8550b..80649fc 100644 --- a/sfw/core/file_access.h +++ b/sfw/core/file_access.h @@ -126,8 +126,10 @@ public: virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType + Error open(const String &p_path, int p_mode_flags); + static FileAccess *create(); /// Helper that Creates a file access - static FileAccess *create_and_open(const String &p_path, int p_mode_flags, Error *r_error = nullptr); /// Create a file access (for the current platform) this is the only portable way of accessing files. + static FileAccess *create_and_open(const String &p_path, int p_mode_flags, Error *r_error = nullptr); static bool exists(const String &p_name); ///< return true if a file exists static uint64_t get_modified_time(const String &p_file); static uint32_t get_unix_permissions(const String &p_file);