diff --git a/core/file_cache.cpp b/core/file_cache.cpp index 286a59a..6ed8a39 100644 --- a/core/file_cache.cpp +++ b/core/file_cache.cpp @@ -30,7 +30,7 @@ void FileCache::wwwroot_evaluate_dir(const char *path, const bool should_exist) Ref dir; dir.instance(); - ERR_FAIL_COND_MSG(!dir->open(path, true), "Error opening wwwroot! folder: " + String(path)); + ERR_FAIL_COND_MSG(!dir->open_dir(path, true), "Error opening wwwroot! folder: " + String(path)); while (dir->has_next()) { @@ -46,7 +46,7 @@ void FileCache::wwwroot_evaluate_dir(const char *path, const bool should_exist) } } - dir->close(); + dir->close_dir(); } bool FileCache::get_cached_body(const String &path, String *body) { diff --git a/core/os/directory.cpp b/core/os/directory.cpp index fd5c1d7..7a17d23 100644 --- a/core/os/directory.cpp +++ b/core/os/directory.cpp @@ -1,7 +1,7 @@ #include "directory.h" -Error Directory::open(const String &path, bool skip_specials) { - if (_open) { +Error Directory::open_dir(const String &path, bool skip_specials) { + if (_dir_open) { return ERR_CANT_ACQUIRE_RESOURCE; } @@ -11,13 +11,13 @@ Error Directory::open(const String &path, bool skip_specials) { return FAILED; } - _open = true; + _dir_open = true; return OK; } -Error Directory::open(const char *path, bool skip_specials) { - if (_open) { +Error Directory::open_dir(const char *path, bool skip_specials) { + if (_dir_open) { return ERR_CANT_ACQUIRE_RESOURCE; } @@ -27,19 +27,19 @@ Error Directory::open(const char *path, bool skip_specials) { return FAILED; } - _open = true; + _dir_open = true; return OK; } -void Directory::close() { - if (!_open) { +void Directory::close_dir() { + if (!_dir_open) { return; } tinydir_close(&_dir); - _open = false; + _dir_open = false; } bool Directory::has_next() { @@ -124,20 +124,20 @@ Error Directory::read_file_into(const String &path, String *str) { return OK; } -bool Directory::is_open() { - return _open; +bool Directory::is_dir_open() { + return _dir_open; } -bool Directory::is_closed() { - return !_open; +bool Directory::is_dir_closed() { + return !_dir_open; } Directory::Directory() { _skip_specials = false; _read_file_result = 0; - _open = false; + _dir_open = false; } Directory::~Directory() { - if (is_open()) { - close(); + if (is_dir_open()) { + close_dir(); } } diff --git a/core/os/directory.h b/core/os/directory.h index 9127553..4db96a6 100644 --- a/core/os/directory.h +++ b/core/os/directory.h @@ -10,9 +10,9 @@ class Directory : public Reference { RCPP_OBJECT(Directory, Reference); public: - Error open(const String &path, bool skip_specials = true); - Error open(const char *path, bool skip_specials = true); - void close(); + Error open_dir(const String &path, bool skip_specials = true); + Error open_dir(const char *path, bool skip_specials = true); + void close_dir(); bool has_next(); void next(); @@ -30,8 +30,8 @@ public: String read_file(const String &path); Error read_file_into(const String &path, String *str); - bool is_open(); - bool is_closed(); + bool is_dir_open(); + bool is_dir_closed(); Directory(); virtual ~Directory(); @@ -42,7 +42,7 @@ private: tinydir_dir _dir; tinydir_file _file; - bool _open; + bool _dir_open; }; #endif diff --git a/modules/paged_article/paged_article.cpp b/modules/paged_article/paged_article.cpp index 2864799..f21e2b3 100644 --- a/modules/paged_article/paged_article.cpp +++ b/modules/paged_article/paged_article.cpp @@ -47,7 +47,7 @@ void PagedArticle::load() { Ref dir; dir.instance(); - ERR_FAIL_COND_MSG(!dir->open(articles_folder.c_str(), false), "Error opening PagedArticle::folder! folder: " + articles_folder); + ERR_FAIL_COND_MSG(!dir->open_dir(articles_folder.c_str(), false), "Error opening PagedArticle::folder! folder: " + articles_folder); Vector files; @@ -59,7 +59,7 @@ void PagedArticle::load() { } } - dir->close(); + dir->close_dir(); if (files.size() == 0) { return;