summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/filesel.cpp
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2021-08-22 09:06:15 +1000
committer GitHub <noreply@github.com>2021-08-22 09:06:15 +1000
commite8bbea1fc6e94e14768509d322f6c624403ffb36 (patch)
tree74dd1606a900d83de8aecff17a6737af4113308d /src/frontend/mame/ui/filesel.cpp
parente319bde5fc3696d7f48f62b15b6366c4377fe5d1 (diff)
formats, osd, util: Started refactoring file I/O stuff. (#8456)
Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
Diffstat (limited to 'src/frontend/mame/ui/filesel.cpp')
-rw-r--r--src/frontend/mame/ui/filesel.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp
index b722afab60d..bc5c5abbd12 100644
--- a/src/frontend/mame/ui/filesel.cpp
+++ b/src/frontend/mame/ui/filesel.cpp
@@ -316,8 +316,8 @@ void menu_file_selector::select_item(const file_selector_entry &entry)
{
// drive/directory - first check the path
util::zippath_directory::ptr dir;
- osd_file::error const err = util::zippath_directory::open(entry.fullpath, dir);
- if (err != osd_file::error::NONE)
+ std::error_condition const err = util::zippath_directory::open(entry.fullpath, dir);
+ if (err)
{
// this path is problematic; present the user with an error and bail
ui().popup_time(1, _("Error accessing %s"), entry.fullpath);
@@ -399,7 +399,7 @@ void menu_file_selector::populate(float &customtop, float &custombottom)
// open the directory
util::zippath_directory::ptr directory;
- osd_file::error const err = util::zippath_directory::open(m_current_directory, directory);
+ std::error_condition const err = util::zippath_directory::open(m_current_directory, directory);
// add the "[empty slot]" entry if available
if (m_has_empty)
@@ -421,9 +421,11 @@ void menu_file_selector::populate(float &customtop, float &custombottom)
std::size_t const first = m_entrylist.size() + 1;
// build the menu for each item
- if (osd_file::error::NONE != err)
+ if (err)
{
- osd_printf_verbose("menu_file_selector::populate: error opening directory '%s' (%d)\n", m_current_directory, int(err));
+ osd_printf_verbose(
+ "menu_file_selector::populate: error opening directory '%s' (%s:%d %s)\n",
+ m_current_directory, err.category().name(), err.value(), err.message());
}
else
{