diff options
Diffstat (limited to 'src/emu/netlist/nl_util.h')
-rw-r--r-- | src/emu/netlist/nl_util.h | 66 |
1 files changed, 3 insertions, 63 deletions
diff --git a/src/emu/netlist/nl_util.h b/src/emu/netlist/nl_util.h index cf5ee6a3a7b..09a06ce976a 100644 --- a/src/emu/netlist/nl_util.h +++ b/src/emu/netlist/nl_util.h @@ -8,11 +8,12 @@ #ifndef NL_UTIL_H_ #define NL_UTIL_H_ -#include "pstring.h" -#include "plists.h" #include <cmath> #include <cstring> +#include "plib/pstring.h" +#include "plib/plists.h" + class nl_util { // this is purely static @@ -20,68 +21,7 @@ private: nl_util() {}; public: - typedef plist_t<pstring> pstring_list; - - static pstring_list split(const pstring &str, const pstring &onstr, bool ignore_empty = false) - { - pstring_list temp; - - int p = 0; - int pn; - - pn = str.find(onstr, p); - while (pn>=0) - { - pstring t = str.substr(p, pn - p); - if (!ignore_empty || t.len() != 0) - temp.add(t); - p = pn + onstr.len(); - pn = str.find(onstr, p); - } - if (p<str.len()) - { - pstring t = str.substr(p); - if (!ignore_empty || t.len() != 0) - temp.add(t); - } - return temp; - } - static pstring_list splitexpr(const pstring &str, const pstring_list &onstrl) - { - pstring_list temp; - pstring col = ""; - - int i = 0; - while (i<str.len()) - { - int p = -1; - for (std::size_t j=0; j < onstrl.size(); j++) - { - if (std::strncmp(onstrl[j].cstr(), &(str.cstr()[i]), onstrl[j].len())==0) - { - p = j; - break; - } - } - if (p>=0) - { - if (col != "") - temp.add(col); - col = ""; - temp.add(onstrl[p]); - i += onstrl[p].len(); - } - else - { - col += str.cstr()[i]; - i++; - } - } - if (col != "") - temp.add(col); - return temp; - } static const pstring environment(const pstring &var, const pstring &default_val = "") { |