summaryrefslogtreecommitdiff
path: root/app/mac/impl
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 16:40:27 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 16:40:27 +0100
commitdbed1c0fa5599b1b96c221b89b10f1e350351645 (patch)
tree1a4809d3cac122179e1faced6a56d234a04d96b1 /app/mac/impl
parentd1b61b02b1a6bdaa337ff060eda3d3d5fb67827d (diff)
refactor: file_browser::item -> file_browser::entry
Diffstat (limited to 'app/mac/impl')
-rw-r--r--app/mac/impl/file-browser-posix.cc16
-rw-r--r--app/mac/impl/file-browser-posix.hh2
2 files changed, 9 insertions, 9 deletions
diff --git a/app/mac/impl/file-browser-posix.cc b/app/mac/impl/file-browser-posix.cc
index 8cde6b7..500ce83 100644
--- a/app/mac/impl/file-browser-posix.cc
+++ b/app/mac/impl/file-browser-posix.cc
@@ -39,31 +39,31 @@ namespace nes::app::mac
}
}
- auto file_browser_posix::read_next(item* out_item) -> bool
+ auto file_browser_posix::read_next(entry* out_entry) -> bool
{
if (!it_) { return false; }
while (true)
{
errno = 0;
- auto const entry = readdir(it_);
- if (!entry)
+ auto const ent = readdir(it_);
+ if (!ent)
{
if (errno) { perror("file_browser_posix: readdir"); }
return false;
}
- auto const name = std::string_view{ entry->d_name };
+ auto const name = std::string_view{ ent->d_name };
if (name.length() > max_name_length) { continue; }
if (name[0] == '.') { continue; }
- auto type = item_type::directory;
- if (entry->d_type == DT_DIR) { type = item_type::directory; }
- else if (entry->d_type == DT_REG) { type = item_type::file; }
+ auto type = entry_type{};
+ if (ent->d_type == DT_DIR) { type = entry_type::directory; }
+ else if (ent->d_type == DT_REG) { type = entry_type::file; }
else { continue; }
it_pos_ += 1;
- if (out_item) { *out_item = item{ type, name }; }
+ if (out_entry) { *out_entry = entry{ type, name }; }
return true;
}
}
diff --git a/app/mac/impl/file-browser-posix.hh b/app/mac/impl/file-browser-posix.hh
index 4962907..b60ce2b 100644
--- a/app/mac/impl/file-browser-posix.hh
+++ b/app/mac/impl/file-browser-posix.hh
@@ -19,7 +19,7 @@ namespace nes::app::mac
auto get_path() const -> path_view override { return path_.get_components(); }
auto seek(u32) -> void override;
- auto read_next(item* out_item) -> bool override;
+ auto read_next(entry* out_entry) -> bool override;
auto navigate_up() -> status override;
auto navigate(std::string_view) -> status override;
auto load(std::string_view, span<u8>, u32* out_length) -> status override;