mirror of https://github.com/stella-emu/stella.git
A cleaner fix for the last commit.
This commit is contained in:
parent
7c34bdd27b
commit
2e556fe6b6
|
@ -89,7 +89,7 @@ bool PhysicalJoystick::setMap(const json& map)
|
|||
continue;
|
||||
if(entry.key() == "port")
|
||||
{
|
||||
port = getPort(entry.value());
|
||||
port = getPort(string{entry.value()}); // json doesn't support string_view
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ string PhysicalJoystick::getName(const PhysicalJoystick::Port _port) const
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
PhysicalJoystick::Port PhysicalJoystick::getPort(const string& portName) const
|
||||
PhysicalJoystick::Port PhysicalJoystick::getPort(string_view portName) const
|
||||
{
|
||||
static constexpr std::array<string_view,
|
||||
static_cast<int>(PhysicalJoystick::Port::NUM_PORTS)> NAMES =
|
||||
|
|
|
@ -90,7 +90,7 @@ class PhysicalJoystick
|
|||
|
||||
// Convert from string to Port type and vice versa
|
||||
string getName(const Port _port) const;
|
||||
Port getPort(const string& portName) const; // FIXME: allow string_view
|
||||
Port getPort(string_view portName) const;
|
||||
|
||||
friend ostream& operator<<(ostream& os, const PhysicalJoystick& s) {
|
||||
os << " ID: " << s.ID << ", name: " << s.name << ", numaxis: " << s.numAxes
|
||||
|
|
Loading…
Reference in New Issue