diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2021-01-20 17:46:03 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2021-01-20 18:06:15 -0500 |
commit | 91921618c2e06bd0ed073b8efccd31a127c9012d (patch) | |
tree | d3958b32d8db82540cd31083766b22991eb8e8ae /src/emu/rendlay.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/rendlay.cpp')
-rw-r--r-- | src/emu/rendlay.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index ec2cec7c336..e7ba920af84 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -149,6 +149,16 @@ private: , m_text(std::move(t)) , m_text_valid(true) { } + entry(std::string &&name, std::string_view t) + : m_name(std::move(name)) + , m_text(t) + , m_text_valid(true) + { } + entry(std::string &&name, const char *t) + : m_name(std::move(name)) + , m_text(t) + , m_text_valid(true) + { } entry(std::string &&name, s64 i) : m_name(std::move(name)) , m_int(i) @@ -766,7 +776,7 @@ public: std::string get_attribute_subtag(util::xml::data_node const &node, char const *name) { std::string const *const attrib(node.get_attribute_string_ptr(name)); - return attrib ? device().subtag(std::string(expand(*attrib)).c_str()) : std::string(); + return attrib ? device().subtag(expand(*attrib)) : std::string(); } int get_attribute_int(util::xml::data_node const &node, const char *name, int defvalue) @@ -4499,7 +4509,7 @@ layout_view::item::item( if (itemnode.has_attribute("tag")) { std::string_view const tag(env.get_attribute_string(itemnode, "tag")); - m_screen = dynamic_cast<screen_device *>(env.device().subdevice(std::string(tag).c_str())); + m_screen = dynamic_cast<screen_device *>(env.device().subdevice(tag)); if (!m_screen) throw layout_reference_error(util::string_format("invalid screen tag '%d'", tag)); } |