mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
Merge pull request #1165 from npwoods/diimage_add_format
Created device_image_interface::add_format() protected member and made device_image_interface::m_formatlist be private
This commit is contained in:
commit
c703235246
@ -61,7 +61,7 @@ void cdrom_image_device::device_config_complete()
|
||||
{
|
||||
m_extension_list = "chd,cue,toc,nrg,gdi,iso,cdr";
|
||||
|
||||
m_formatlist.push_back(std::make_unique<image_device_format>("chdcd", "CD-ROM drive", m_extension_list, cd_option_spec));
|
||||
add_format("chdcd", "CD-ROM drive", m_extension_list, cd_option_spec);
|
||||
|
||||
// set brief and instance name
|
||||
update_names();
|
||||
|
@ -56,7 +56,7 @@ diablo_image_device::~diablo_image_device()
|
||||
|
||||
void diablo_image_device::device_config_complete()
|
||||
{
|
||||
m_formatlist.push_back(std::make_unique<image_device_format>("chd", "CHD Hard drive", "chd,dsk", dsk_option_spec));
|
||||
add_format("chd", "CHD Hard drive", "chd,dsk", dsk_option_spec);
|
||||
|
||||
// set brief and instance name
|
||||
update_names();
|
||||
|
@ -825,7 +825,7 @@ void legacy_floppy_image_device::device_config_complete()
|
||||
// only add if creatable
|
||||
if (floppy_options[i].param_guidelines) {
|
||||
// allocate a new format and append it to the list
|
||||
m_formatlist.push_back(std::make_unique<image_device_format>(floppy_options[i].name, floppy_options[i].description, floppy_options[i].extensions, floppy_options[i].param_guidelines));
|
||||
add_format(floppy_options[i].name, floppy_options[i].description, floppy_options[i].extensions, floppy_options[i].param_guidelines);
|
||||
}
|
||||
image_specify_extension( m_extension_list, 256, floppy_options[i].extensions );
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void floppy_image_device::set_formats(const floppy_format_type *formats)
|
||||
else
|
||||
fif_list->append(fif);
|
||||
|
||||
m_formatlist.push_back(std::make_unique<image_device_format>(fif->name(), fif->description(), fif->extensions(), ""));
|
||||
add_format(fif->name(), fif->description(), fif->extensions(), "");
|
||||
|
||||
image_specify_extension( extension_list, 256, fif->extensions() );
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ harddisk_image_device::~harddisk_image_device()
|
||||
|
||||
void harddisk_image_device::device_config_complete()
|
||||
{
|
||||
m_formatlist.push_back(std::make_unique<image_device_format>("chd", "CHD Hard drive", "chd,hd", hd_option_spec));
|
||||
add_format("chd", "CHD Hard drive", "chd,hd", hd_option_spec);
|
||||
|
||||
// set brief and instance name
|
||||
update_names();
|
||||
|
@ -237,6 +237,27 @@ const image_device_format *device_image_interface::device_get_named_creatable_fo
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// add_format
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_image_interface::add_format(std::unique_ptr<image_device_format> &&format)
|
||||
{
|
||||
m_formatlist.push_back(std::move(format));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// add_format
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_image_interface::add_format(std::string &&name, std::string &&description, std::string &&extensions, std::string &&optspec)
|
||||
{
|
||||
auto format = std::make_unique<image_device_format>(std::move(name), std::move(description), std::move(extensions), std::move(optspec));
|
||||
add_format(std::move(format));
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
ERROR HANDLING
|
||||
****************************************************************************/
|
||||
|
@ -273,6 +273,9 @@ protected:
|
||||
bool load_software_part(const char *path, const software_part *&swpart);
|
||||
std::string software_get_default_slot(const char *default_card_slot) const;
|
||||
|
||||
void add_format(std::unique_ptr<image_device_format> &&format);
|
||||
void add_format(std::string &&name, std::string &&description, std::string &&extensions, std::string &&optspec);
|
||||
|
||||
// derived class overrides
|
||||
|
||||
// configuration
|
||||
@ -320,9 +323,6 @@ protected:
|
||||
std::string m_brief_instance_name;
|
||||
std::string m_instance_name;
|
||||
|
||||
// creation info
|
||||
formatlist_type m_formatlist;
|
||||
|
||||
// in the case of arcade cabinet with fixed carts inserted,
|
||||
// we want to disable command line cart loading...
|
||||
bool m_user_loadable;
|
||||
@ -331,6 +331,9 @@ protected:
|
||||
|
||||
private:
|
||||
static image_error_t image_error_from_file_error(osd_file::error filerr);
|
||||
|
||||
// creation info
|
||||
formatlist_type m_formatlist;
|
||||
};
|
||||
|
||||
// iterator
|
||||
|
Loading…
Reference in New Issue
Block a user