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:
Collin Kidder
2015-08-17 21:19:12 -04:00
parent 7f0c077891
commit 248538e943
2 changed files with 84 additions and 49 deletions
+31
View File
@@ -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