diff options
author | 2021-01-20 17:46:03 -0500 | |
---|---|---|
committer | 2021-01-20 18:06:15 -0500 | |
commit | 91921618c2e06bd0ed073b8efccd31a127c9012d (patch) | |
tree | d3958b32d8db82540cd31083766b22991eb8e8ae /src/osd/modules/lib/osdobj_common.h | |
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/osd/modules/lib/osdobj_common.h')
-rw-r--r-- | src/osd/modules/lib/osdobj_common.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h index 2df6a91b827..9eeffe7c7b9 100644 --- a/src/osd/modules/lib/osdobj_common.h +++ b/src/osd/modules/lib/osdobj_common.h @@ -129,10 +129,10 @@ public: const char *aspect() const { return value(OSDOPTION_ASPECT); } const char *resolution() const { return value(OSDOPTION_RESOLUTION); } const char *view() const { return value(OSDOPTION_VIEW); } - const char *screen(int index) const { return value(string_format("%s%d", OSDOPTION_SCREEN, index).c_str()); } - const char *aspect(int index) const { return value(string_format("%s%d", OSDOPTION_ASPECT, index).c_str()); } - const char *resolution(int index) const { return value(string_format("%s%d", OSDOPTION_RESOLUTION, index).c_str()); } - const char *view(int index) const { return value(string_format("%s%d", OSDOPTION_VIEW, index).c_str()); } + const char *screen(int index) const { return value(string_format("%s%d", OSDOPTION_SCREEN, index)); } + const char *aspect(int index) const { return value(string_format("%s%d", OSDOPTION_ASPECT, index)); } + const char *resolution(int index) const { return value(string_format("%s%d", OSDOPTION_RESOLUTION, index)); } + const char *view(int index) const { return value(string_format("%s%d", OSDOPTION_VIEW, index)); } // full screen options bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); } @@ -148,8 +148,8 @@ public: bool gl_pbo() const { return bool_value(OSDOPTION_GL_PBO); } bool gl_glsl() const { return bool_value(OSDOPTION_GL_GLSL); } int glsl_filter() const { return int_value(OSDOPTION_GLSL_FILTER); } - const char *shader_mame(int index) const { return value(string_format("%s%d", OSDOPTION_SHADER_MAME, index).c_str()); } - const char *shader_screen(int index) const { return value(string_format("%s%d", OSDOPTION_SHADER_SCREEN, index).c_str()); } + const char *shader_mame(int index) const { return value(string_format("%s%d", OSDOPTION_SHADER_MAME, index)); } + const char *shader_screen(int index) const { return value(string_format("%s%d", OSDOPTION_SHADER_SCREEN, index)); } // sound options const char *sound() const { return value(OSDOPTION_SOUND); } @@ -157,7 +157,7 @@ public: // CoreAudio specific options const char *audio_output() const { return value(OSDOPTION_AUDIO_OUTPUT); } - const char *audio_effect(int index) const { return value(string_format("%s%d", OSDOPTION_AUDIO_EFFECT, index).c_str()); } + const char *audio_effect(int index) const { return value(string_format("%s%d", OSDOPTION_AUDIO_EFFECT, index)); } // BGFX specific options const char *bgfx_path() const { return value(OSDOPTION_BGFX_PATH); } @@ -274,7 +274,7 @@ private: // FIXME: should be elsewhere osd_module *select_module_options(const core_options &opts, const std::string &opt_name) { - std::string opt_val = opts.exists(opt_name) ? opts.value(opt_name.c_str()) : ""; + std::string opt_val = opts.exists(opt_name) ? opts.value(opt_name) : ""; if (opt_val.compare("auto")==0) opt_val = ""; else if (!m_mod_man.type_has_name(opt_name.c_str(), opt_val.c_str())) |