summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2016-07-07 22:35:55 -0400
committer GitHub <noreply@github.com>2016-07-07 22:35:55 -0400
commit404980f08f78c82f121fa4f7f6ecffb47e2afde9 (patch)
tree8ec43ffafba44271728e189953786c13098682a9
parent7eb9149858c5e8bb1cc8919a72068078071c1a79 (diff)
parent80a7239950ce491f48a9e073101c3409fb05032f (diff)
Merge pull request #1060 from npwoods/image_device_format_extensions_vector
Changed image_device_format::extensions() to be a vector
-rw-r--r--src/emu/diimage.cpp29
-rw-r--r--src/emu/diimage.h17
2 files changed, 36 insertions, 10 deletions
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index 52ad80910f5..d978bb5b73c 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -8,6 +8,7 @@
***************************************************************************/
+#include <regex>
#include "emu.h"
#include "emuopts.h"
#include "drivenum.h"
@@ -44,6 +45,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
//**************************************************************************
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index 92d87fc6b87..f1d3ba94dff 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -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;
};