Browse Source

Add FileAccess::get_access_type()

(cherry picked from commit 8c6b2fbb908261d29a6692dd7a816464c28520d2)
Pedro J. Estébanez 3 years ago
parent
commit
29e235b341
2 changed files with 5 additions and 0 deletions
  1. 4 0
      core/os/file_access.cpp
  2. 1 0
      core/os/file_access.h

+ 4 - 0
core/os/file_access.cpp

@@ -117,6 +117,10 @@ FileAccess::CreateFunc FileAccess::get_create_func(AccessType p_access) {
 	return create_func[p_access];
 	return create_func[p_access];
 };
 };
 
 
+FileAccess::AccessType FileAccess::get_access_type() const {
+	return _access_type;
+}
+
 String FileAccess::fix_path(const String &p_path) const {
 String FileAccess::fix_path(const String &p_path) const {
 	//helper used by file accesses that use a single filesystem
 	//helper used by file accesses that use a single filesystem
 
 

+ 1 - 0
core/os/file_access.h

@@ -59,6 +59,7 @@ public:
 	virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) = 0;
 	virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) = 0;
 
 
 protected:
 protected:
+	AccessType get_access_type() const;
 	String fix_path(const String &p_path) const;
 	String fix_path(const String &p_path) const;
 	virtual Error _open(const String &p_path, int p_mode_flags) = 0; ///< open a file
 	virtual Error _open(const String &p_path, int p_mode_flags) = 0; ///< open a file
 	virtual uint64_t _get_modified_time(const String &p_file) = 0;
 	virtual uint64_t _get_modified_time(const String &p_file) = 0;