mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-15 06:58:37 +02:00
ExpressionParser: Add support for literals.
This commit is contained in:
@ -19,6 +19,7 @@ public:
|
||||
std::string control_name;
|
||||
|
||||
ControlQualifier() : has_device(false) {}
|
||||
|
||||
operator std::string() const
|
||||
{
|
||||
if (has_device)
|
||||
@ -26,6 +27,23 @@ public:
|
||||
else
|
||||
return control_name;
|
||||
}
|
||||
|
||||
void FromString(const std::string& str)
|
||||
{
|
||||
const auto col_pos = str.find_last_of(':');
|
||||
|
||||
has_device = (str.npos != col_pos);
|
||||
if (has_device)
|
||||
{
|
||||
device_qualifier.FromString(str.substr(0, col_pos));
|
||||
control_name = str.substr(col_pos + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
device_qualifier.FromString("");
|
||||
control_name = str;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class ControlFinder
|
||||
|
Reference in New Issue
Block a user