mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
Merge pull request #1060 from npwoods/image_device_format_extensions_vector
Changed image_device_format::extensions() to be a vector
This commit is contained in:
commit
404980f08f
@ -8,6 +8,7 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include <regex>
|
||||
#include "emu.h"
|
||||
#include "emuopts.h"
|
||||
#include "drivenum.h"
|
||||
@ -43,6 +44,34 @@ const image_device_type_info device_image_interface::m_device_info_array[] =
|
||||
};
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// IMAGE DEVICE FORMAT
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ctor
|
||||
//-------------------------------------------------
|
||||
|
||||
image_device_format::image_device_format(const std::string &name, const std::string &description, const std::string &extensions, const std::string &optspec)
|
||||
: m_name(name), m_description(description), m_optspec(optspec)
|
||||
{
|
||||
std::regex comma_regex("\\,");
|
||||
std::copy(
|
||||
std::sregex_token_iterator(extensions.begin(), extensions.end(), comma_regex, -1),
|
||||
std::sregex_token_iterator(),
|
||||
std::back_inserter(m_extensions));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// dtor
|
||||
//-------------------------------------------------
|
||||
|
||||
image_device_format::~image_device_format()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE IMAGE INTERFACE
|
||||
//**************************************************************************
|
||||
|
@ -72,22 +72,19 @@ struct image_device_type_info
|
||||
class image_device_format
|
||||
{
|
||||
public:
|
||||
image_device_format(const char *name, const char *description, const char *extensions, const char *optspec)
|
||||
: m_name(name),
|
||||
m_description(description),
|
||||
m_extensions(extensions),
|
||||
m_optspec(optspec) { }
|
||||
image_device_format(const std::string &name, const std::string &description, const std::string &extensions, const std::string &optspec);
|
||||
~image_device_format();
|
||||
|
||||
const std::string &name() const { return m_name; }
|
||||
const std::string &description() const { return m_description; }
|
||||
const std::string &extensions() const { return m_extensions; }
|
||||
const std::vector<std::string> &extensions() const { return m_extensions; }
|
||||
const std::string &optspec() const { return m_optspec; }
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
std::string m_description;
|
||||
std::string m_extensions;
|
||||
std::string m_optspec;
|
||||
std::string m_name;
|
||||
std::string m_description;
|
||||
std::vector<std::string> m_extensions;
|
||||
std::string m_optspec;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user