add temporary ParseStringToNum2

This commit is contained in:
canpadawan
2016-07-19 10:34:43 +02:00
parent 72ee214812
commit 7bede56e68
+12 -1
View File
@@ -23,7 +23,7 @@ public:
if (input.length() < 3) temp = 0;
else temp = input.right(input.size() - 2).toLongLong(NULL, 16);
}
else if (input.startsWith("B")) //binary number
else if (input.startsWith("0B") || input.startsWith("B")) //binary number
{
input = input.right(input.size() - 1); //remove the B
for (int i = 0; i < input.length(); i++)
@@ -44,6 +44,17 @@ public:
return ParseStringToNum(input.toUtf8());
}
static uint ParseStringToNum2(QString pInput, bool* pOk_p = NULL)
{
if(pInput.startsWith("0b"))
{
pInput.remove(0, 2);
return pInput.toUInt(pOk_p, 2);
}
return pInput.toUInt(pOk_p, 0);
}
static long GetTimeMS()
{
QDateTime stamp = QDateTime::currentDateTime();