Merge pull request #1188 from npwoods/more_diimage_stdstring

More conversion of 'const char *' --> std::string in diimage
This commit is contained in:
R. Belmont 2016-08-07 15:58:00 -04:00 committed by GitHub
commit 9342233fda
5 changed files with 12 additions and 12 deletions

View File

@ -398,13 +398,13 @@ void device_image_interface::setup_working_directory()
// valid even if not mounted // valid even if not mounted
//------------------------------------------------- //-------------------------------------------------
const char * device_image_interface::working_directory() const std::string &device_image_interface::working_directory()
{ {
// check to see if we've never initialized the working directory // check to see if we've never initialized the working directory
if (m_working_directory.empty()) if (m_working_directory.empty())
setup_working_directory(); setup_working_directory();
return m_working_directory.c_str(); return m_working_directory;
} }

View File

@ -195,9 +195,9 @@ public:
// configuration access // configuration access
void set_init_phase() { m_init_phase = true; } void set_init_phase() { m_init_phase = true; }
const char* longname() const { return m_longname.c_str(); } const std::string &longname() const { return m_longname; }
const char* manufacturer() const { return m_manufacturer.c_str(); } const std::string &manufacturer() const { return m_manufacturer; }
const char* year() const { return m_year.c_str(); } const std::string &year() const { return m_year; }
UINT32 supported() const { return m_supported; } UINT32 supported() const { return m_supported; }
const software_info *software_entry() const { return m_software_info_ptr; } const software_info *software_entry() const { return m_software_info_ptr; }
@ -206,7 +206,7 @@ public:
bool loaded_through_softlist() const { return m_software_info_ptr != nullptr; } bool loaded_through_softlist() const { return m_software_info_ptr != nullptr; }
void set_working_directory(const char *working_directory) { m_working_directory = working_directory; } void set_working_directory(const char *working_directory) { m_working_directory = working_directory; }
const char * working_directory(); const std::string &working_directory();
UINT8 *get_software_region(const char *tag); UINT8 *get_software_region(const char *tag);
UINT32 get_software_region_length(const char *tag); UINT32 get_software_region_length(const char *tag);

View File

@ -145,7 +145,7 @@ void image_manager::config_save(config_type cfg_type, xml_data_node *parentnode)
if (node != nullptr) if (node != nullptr)
{ {
xml_set_attribute(node, "instance", dev_instance); xml_set_attribute(node, "instance", dev_instance);
xml_set_attribute(node, "directory", image.working_directory()); xml_set_attribute(node, "directory", image.working_directory().c_str());
} }
} }
} }

View File

@ -51,7 +51,7 @@ menu_control_device_image::menu_control_device_image(mame_ui_manager &mui, rende
if (m_swi != nullptr) if (m_swi != nullptr)
{ {
m_state = START_OTHER_PART; m_state = START_OTHER_PART;
m_current_directory.assign(m_image.working_directory()); m_current_directory = m_image.working_directory();
} }
else else
{ {
@ -65,7 +65,7 @@ menu_control_device_image::menu_control_device_image(mame_ui_manager &mui, rende
} }
else else
{ {
m_current_directory.assign(m_image.working_directory()); m_current_directory = m_image.working_directory();
} }
// check to see if the path exists; if not clear it // check to see if the path exists; if not clear it

View File

@ -195,10 +195,10 @@ void favorite_manager::add_favorite_game()
auto part = image.part_entry(); auto part = image.part_entry();
ui_software_info tmpmatches; ui_software_info tmpmatches;
tmpmatches.shortname = swinfo->shortname(); tmpmatches.shortname = swinfo->shortname();
tmpmatches.longname = strensure(image.longname()); tmpmatches.longname = image.longname();
tmpmatches.parentname = swinfo->parentname(); tmpmatches.parentname = swinfo->parentname();
tmpmatches.year = strensure(image.year()); tmpmatches.year = image.year();
tmpmatches.publisher = strensure(image.manufacturer()); tmpmatches.publisher = image.manufacturer();
tmpmatches.supported = image.supported(); tmpmatches.supported = image.supported();
tmpmatches.part = part->name(); tmpmatches.part = part->name();
tmpmatches.driver = &machine().system(); tmpmatches.driver = &machine().system();