From a8bc9f3e78788bdf0be7348fcbfac15c127f1f48 Mon Sep 17 00:00:00 2001 From: Muller-Castro <37383316+Muller-Castro@users.noreply.github.com> Date: Mon, 8 Jan 2024 22:36:19 -0300 Subject: Add const lvalue ref to core/* container parameters --- core/io/dir_access.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/io/dir_access.h') diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 4ee69571f2..d175235b98 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -54,7 +54,7 @@ private: static CreateFunc create_func[ACCESS_MAX]; ///< set this to instance a filesystem object static Ref _open(const String &p_path); - Error _copy_dir(Ref &p_target_da, String p_to, int p_chmod_flags, bool p_copy_links); + Error _copy_dir(Ref &p_target_da, const String &p_to, int p_chmod_flags, bool p_copy_links); PackedStringArray _get_contents(bool p_directories); thread_local static Error last_dir_open_error; @@ -68,7 +68,7 @@ protected: virtual String _get_root_string() const; AccessType get_access_type() const; - virtual String fix_path(String p_path) const; + virtual String fix_path(const String &p_path) const; template static Ref _create_builtin() { @@ -91,18 +91,18 @@ public: virtual Error change_dir(String p_dir) = 0; ///< can be relative or absolute, return false on success virtual String get_current_dir(bool p_include_drive = true) const = 0; ///< return current dir location virtual Error make_dir(String p_dir) = 0; - virtual Error make_dir_recursive(String p_dir); + virtual Error make_dir_recursive(const String &p_dir); virtual Error erase_contents_recursive(); //super dangerous, use with care! virtual bool file_exists(String p_file) = 0; virtual bool dir_exists(String p_dir) = 0; virtual bool is_readable(String p_dir) { return true; }; virtual bool is_writable(String p_dir) { return true; }; - static bool exists(String p_dir); + static bool exists(const String &p_dir); virtual uint64_t get_space_left() = 0; - Error copy_dir(String p_from, String p_to, int p_chmod_flags = -1, bool p_copy_links = false); - virtual Error copy(String p_from, String p_to, int p_chmod_flags = -1); + Error copy_dir(const String &p_from, String p_to, int p_chmod_flags = -1, bool p_copy_links = false); + virtual Error copy(const String &p_from, const String &p_to, int p_chmod_flags = -1); virtual Error rename(String p_from, String p_to) = 0; virtual Error remove(String p_name) = 0; @@ -112,7 +112,7 @@ public: // Meant for editor code when we want to quickly remove a file without custom // handling (e.g. removing a cache file). - static void remove_file_or_error(String p_path) { + static void remove_file_or_error(const String &p_path) { Ref da = create(ACCESS_FILESYSTEM); if (da->file_exists(p_path)) { if (da->remove(p_path) != OK) { -- cgit v1.2.3