Modification of the modifier parsing strategy to allow for a lot more leeway in how you enter the values in. Previously the syntax was *VERY* strict. Now it's easier to get it to accept your modifier strings.
This commit is contained in:
@@ -72,6 +72,37 @@ public:
|
||||
}
|
||||
else return formatHexNum(value);
|
||||
}
|
||||
|
||||
//parses the input string to grab as much of it as possible while staying alpha numeric
|
||||
static QString grabAlphaNumeric(QString &input)
|
||||
{
|
||||
QString builder;
|
||||
QChar thisChar;
|
||||
for (int i = 0; i < input.length(); i++)
|
||||
{
|
||||
thisChar = input[i];
|
||||
if (thisChar.isLetterOrNumber() || thisChar == ':') builder.append(input[i]);
|
||||
else
|
||||
{
|
||||
input = input.right(input.length() - i);
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
static QString grabOperation(QString &input)
|
||||
{
|
||||
QString builder;
|
||||
QChar thisChar = input[0];
|
||||
|
||||
if (thisChar == '+' || thisChar == '-' || thisChar == '*' || thisChar == '/' || thisChar == '^' || thisChar == '&' || thisChar == '|' || thisChar == "=")
|
||||
{
|
||||
input = input.right(input.length() - 1);
|
||||
builder = thisChar;
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // UTILITY_H
|
||||
|
||||
Reference in New Issue
Block a user