summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2022-02-17 17:28:31 -0500
committer AJR <ajrhacker@users.noreply.github.com>2022-02-17 17:28:31 -0500
commit2db924e5ec91c90b257eda774034e8b78a4a66c2 (patch)
treebbe2d5ba4614fc95f37404815142898f113c2bb0
parent5668cd4d793f62bb5e8e9cb1fd05cae861cfef77 (diff)
fileio.cpp: Remove optional second argument of path_iterator::next
-rw-r--r--src/emu/fileio.cpp12
-rw-r--r--src/emu/fileio.h2
-rw-r--r--src/frontend/mame/audit.cpp5
-rw-r--r--src/frontend/mame/ui/dirmenu.cpp6
4 files changed, 14 insertions, 11 deletions
diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp
index 6d5d6b8a806..21634d8f211 100644
--- a/src/emu/fileio.cpp
+++ b/src/emu/fileio.cpp
@@ -107,7 +107,7 @@ path_iterator &path_iterator::operator=(path_iterator const &that)
// multipath sequence
//-------------------------------------------------
-bool path_iterator::next(std::string &buffer, const char *name)
+bool path_iterator::next(std::string &buffer)
{
// if none left, return false to indicate we are done
if (!m_is_first && (m_searchpath.cend() == m_current))
@@ -120,10 +120,6 @@ bool path_iterator::next(std::string &buffer, const char *name)
if (m_searchpath.cend() != m_current)
++m_current;
- // append the name if we have one
- if (name)
- util::path_append(buffer, name);
-
// bump the index and return true
m_is_first = false;
return true;
@@ -160,9 +156,13 @@ const osd::directory::entry *file_enumerator::next(const char *subdir)
while (!m_curdir)
{
// if we fail to get anything more, we're done
- if (!m_iterator.next(m_pathbuffer, subdir))
+ if (!m_iterator.next(m_pathbuffer))
return nullptr;
+ // append the subdir if we have one
+ if (subdir)
+ util::path_append(m_pathbuffer, subdir);
+
// open the path
m_curdir = osd::directory::open(m_pathbuffer);
}
diff --git a/src/emu/fileio.h b/src/emu/fileio.h
index 91aedad173e..7398e649c6e 100644
--- a/src/emu/fileio.h
+++ b/src/emu/fileio.h
@@ -61,7 +61,7 @@ public:
path_iterator &operator=(path_iterator const &that);
// main interface
- bool next(std::string &buffer, const char *name = nullptr);
+ bool next(std::string &buffer);
void reset();
private:
diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp
index f4d1d2e1438..069c524022e 100644
--- a/src/frontend/mame/audit.cpp
+++ b/src/frontend/mame/audit.cpp
@@ -20,6 +20,7 @@
#include "softlist_dev.h"
#include "chd.h"
+#include "path.h"
#include <algorithm>
@@ -423,8 +424,10 @@ media_auditor::summary media_auditor::audit_samples()
emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
path_iterator path(searchpath);
std::string curpath;
- while (path.next(curpath, samplename))
+ while (path.next(curpath))
{
+ util::path_append(curpath, samplename);
+
// attempt to access the file (.flac) or (.wav)
std::error_condition filerr = file.open(curpath + ".flac");
if (filerr)
diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp
index 32916d6e8f0..920a847c001 100644
--- a/src/frontend/mame/ui/dirmenu.cpp
+++ b/src/frontend/mame/ui/dirmenu.cpp
@@ -183,7 +183,7 @@ void menu_display_actual::populate(float &customtop, float &custombottom)
path_iterator path(m_searchpath);
std::string curpath;
m_folders.clear();
- while (path.next(curpath, nullptr))
+ while (path.next(curpath))
m_folders.push_back(curpath);
item_append((s_folders[m_ref].action == CHANGE) ? _("Change Folder") : _("Add Folder"), 0, (void *)ADD_CHANGE);
@@ -238,7 +238,7 @@ menu_add_change_folder::menu_add_change_folder(mame_ui_manager &mui, render_cont
path_iterator path(searchpath);
std::string curpath;
- while (path.next(curpath, nullptr))
+ while (path.next(curpath))
m_folders.push_back(curpath);
}
@@ -464,7 +464,7 @@ menu_remove_folder::menu_remove_folder(mame_ui_manager &mui, render_container &c
path_iterator path(m_searchpath);
std::string curpath;
- while (path.next(curpath, nullptr))
+ while (path.next(curpath))
m_folders.push_back(curpath);
}