diff options
author | 2016-08-10 22:38:57 +1000 | |
---|---|---|
committer | 2016-08-10 22:38:57 +1000 | |
commit | 88779c9b105dae73dfd098269e3a70540da88fcc (patch) | |
tree | 0ffbb3c80ecb32e2f918b29f40a194ad903ab828 /src/emu/softlist_dev.cpp | |
parent | b37bdb6c32807a463b5147c4f5eaaa0c88eb1d77 (diff) | |
parent | 1f7c2b6a4a8c71751666b10461165f18d8b70cbc (diff) |
Merge pull request #1223 from npwoods/more_softlist_stdstring
Converted more softlist code to use std::string
Diffstat (limited to 'src/emu/softlist_dev.cpp')
-rw-r--r-- | src/emu/softlist_dev.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp index a7ad66fb3a2..013f90c779c 100644 --- a/src/emu/softlist_dev.cpp +++ b/src/emu/softlist_dev.cpp @@ -252,13 +252,13 @@ void software_list_device::display_matches(const machine_config &config, const c // from an intermediate point //------------------------------------------------- -const software_info *software_list_device::find(const char *look_for) +const software_info *software_list_device::find(const std::string &look_for) { - // nullptr search returns nothing - if (look_for == nullptr) + // empty search returns nothing + if (look_for.empty()) return nullptr; - bool iswild = strchr(look_for, '*') != nullptr || strchr(look_for, '?'); + const bool iswild = look_for.find_first_of("*?") != std::string::npos; // find a match (will cause a parse if needed when calling get_info) const auto &info_list = get_info(); @@ -268,8 +268,8 @@ const software_info *software_list_device::find(const char *look_for) [&](const software_info &info) { const char *shortname = info.shortname().c_str(); - return (iswild && core_strwildcmp(look_for, shortname) == 0) - || core_stricmp(look_for, shortname) == 0; + return (iswild && core_strwildcmp(look_for.c_str(), shortname) == 0) + || core_stricmp(look_for.c_str(), shortname) == 0; }); return iter != info_list.end() |