diff options
author | kobewi <kobewi4e@gmail.com> | 2022-09-27 17:35:52 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-09-27 17:35:52 +0200 |
commit | a316401b9949a40e464d2bd1f58c172052c7c1bd (patch) | |
tree | e175de710670c1d56cc4ca779759b37fc99ca785 /core/io/file_access.h | |
parent | c2f66648f1cb7f26adf77cc3cf91052c95be5dbe (diff) |
Make some File/Dir methods private
Diffstat (limited to 'core/io/file_access.h')
-rw-r--r-- | core/io/file_access.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/core/io/file_access.h b/core/io/file_access.h index f8c42d3c0d..8ca44306a0 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -53,6 +53,20 @@ public: ACCESS_MAX }; + enum ModeFlags { + READ = 1, + WRITE = 2, + READ_WRITE = 3, + WRITE_READ = 7, + }; + + enum CompressionMode { + COMPRESSION_FASTLZ = Compression::MODE_FASTLZ, + COMPRESSION_DEFLATE = Compression::MODE_DEFLATE, + COMPRESSION_ZSTD = Compression::MODE_ZSTD, + COMPRESSION_GZIP = Compression::MODE_GZIP + }; + typedef void (*FileCloseFailNotify)(const String &); typedef Ref<FileAccess> (*CreateFunc)(); @@ -69,6 +83,7 @@ protected: String fix_path(const String &p_path) const; virtual Error open_internal(const String &p_path, int p_mode_flags) = 0; ///< open a file virtual uint64_t _get_modified_time(const String &p_file) = 0; + virtual void _set_access_type(AccessType p_access); static FileCloseFailNotify close_fail_notify; @@ -83,25 +98,11 @@ private: return memnew(T); } + static Ref<FileAccess> _open(const String &p_path, ModeFlags p_mode_flags); + public: static void set_file_close_fail_notify_callback(FileCloseFailNotify p_cbk) { close_fail_notify = p_cbk; } - virtual void _set_access_type(AccessType p_access); - - enum ModeFlags { - READ = 1, - WRITE = 2, - READ_WRITE = 3, - WRITE_READ = 7, - }; - - enum CompressionMode { - COMPRESSION_FASTLZ = Compression::MODE_FASTLZ, - COMPRESSION_DEFLATE = Compression::MODE_DEFLATE, - COMPRESSION_ZSTD = Compression::MODE_ZSTD, - COMPRESSION_GZIP = Compression::MODE_GZIP - }; - virtual bool is_open() const = 0; ///< true when file is open virtual String get_path() const { return ""; } /// returns the path for the current open file @@ -173,7 +174,6 @@ public: static Ref<FileAccess> create_for_path(const String &p_path); static Ref<FileAccess> 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 Ref<FileAccess> _open(const String &p_path, ModeFlags p_mode_flags); static Ref<FileAccess> open_encrypted(const String &p_path, ModeFlags p_mode_flags, const Vector<uint8_t> &p_key); static Ref<FileAccess> open_encrypted_pass(const String &p_path, ModeFlags p_mode_flags, const String &p_pass); static Ref<FileAccess> open_compressed(const String &p_path, ModeFlags p_mode_flags, CompressionMode p_compress_mode = COMPRESSION_FASTLZ); |