Also added a non-static open() method to FileAccess.

This commit is contained in:
Relintai 2024-01-19 23:19:34 +01:00
parent bddae4352f
commit fa02bad17b
2 changed files with 7 additions and 1 deletions

View File

@ -691,6 +691,10 @@ Error FileAccess::reopen(const String &p_path, int p_mode_flags) {
return _open(p_path, 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) { FileAccess *FileAccess::create_and_open(const String &p_path, int p_mode_flags, Error *r_error) {
//try packed data first //try packed data first

View File

@ -126,8 +126,10 @@ public:
virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType 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(); /// 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 bool exists(const String &p_name); ///< return true if a file exists
static uint64_t get_modified_time(const String &p_file); static uint64_t get_modified_time(const String &p_file);
static uint32_t get_unix_permissions(const String &p_file); static uint32_t get_unix_permissions(const String &p_file);