diff options
author | 2021-01-20 17:46:03 -0500 | |
---|---|---|
committer | 2021-01-20 18:06:15 -0500 | |
commit | 91921618c2e06bd0ed073b8efccd31a127c9012d (patch) | |
tree | d3958b32d8db82540cd31083766b22991eb8e8ae /src/emu/softlist_dev.cpp | |
parent | c691b79cce315acdfabe1901cb2b5a1e39957bc1 (diff) |
Much more core std::string_view modernization
- Remove corestr.h from emu.h; update a few source files to not use it at all
- Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type
- Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string
- Remove the string-modifying version of zippath_parent
- Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char *
- Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only
- Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this)
- Change output_manager to use std::string_view for output name arguments
- Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now)
- Change miscellaneous other functions to accept std::string_view arguments
- Remove a few string accessor macros from romload.h
- Remove many unnecessary c_str() calls from logging/error messages
Diffstat (limited to 'src/emu/softlist_dev.cpp')
-rw-r--r-- | src/emu/softlist_dev.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp index 56ca2a65d02..e6ee818b449 100644 --- a/src/emu/softlist_dev.cpp +++ b/src/emu/softlist_dev.cpp @@ -16,6 +16,7 @@ #include "romload.h" #include "validity.h" +#include "corestr.h" #include "unicode.h" #include <cctype> @@ -48,7 +49,7 @@ image_software_list_loader image_software_list_loader::s_instance; // false_software_list_loader::load_software //------------------------------------------------- -bool false_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool false_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const { return false; } @@ -58,7 +59,7 @@ bool false_software_list_loader::load_software(device_image_interface &image, so // rom_software_list_loader::load_software //------------------------------------------------- -bool rom_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool rom_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const { swlist.machine().rom_load().load_software_part_region(image.device(), swlist, swname, start_entry); return true; @@ -69,7 +70,7 @@ bool rom_software_list_loader::load_software(device_image_interface &image, soft // image_software_list_loader::load_software //------------------------------------------------- -bool image_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool image_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, std::string_view swname, const rom_entry *start_entry) const { return image.load_software(swlist, swname, start_entry); } @@ -109,7 +110,7 @@ void software_list_device::device_start() // and optional interface //------------------------------------------------- -void software_list_device::find_approx_matches(const std::string &name, int matches, const software_info **list, const char *interface) +void software_list_device::find_approx_matches(std::string_view name, int matches, const software_info **list, const char *interface) { // if no name, return if (name.empty()) @@ -188,7 +189,7 @@ void software_list_device::release() // across all software list devices //------------------------------------------------- -software_list_device *software_list_device::find_by_name(const machine_config &config, const std::string &name) +software_list_device *software_list_device::find_by_name(const machine_config &config, std::string_view name) { // iterate over each device in the system and find a match for (software_list_device &swlistdev : software_list_device_enumerator(config.root_device())) @@ -204,13 +205,13 @@ software_list_device *software_list_device::find_by_name(const machine_config &c // name, across all software list devices //------------------------------------------------- -void software_list_device::display_matches(const machine_config &config, const char *interface, const std::string &name) +void software_list_device::display_matches(const machine_config &config, const char *interface, std::string_view name) { // check if there is at least one software list software_list_device_enumerator deviter(config.root_device()); if (deviter.first() != nullptr) osd_printf_error("\n\"%s\" approximately matches the following\n" - "supported software items (best match first):\n\n", name.c_str()); + "supported software items (best match first):\n\n", name); // iterate through lists for (software_list_device &swlistdev : deviter) |