pivariant, enum, tiny format
This commit is contained in:
@@ -1391,6 +1391,31 @@ PIString PIString::takeNumber() {
|
||||
}
|
||||
|
||||
|
||||
PIString PIString::takeInteger() {
|
||||
PIString ret;
|
||||
int sz = size_s(), ws = -1, we = -1;
|
||||
for (int i = 0; i < sz; ++i) {
|
||||
PIChar c = at(i);
|
||||
if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
|
||||
if (we < 0 && ws >= 0) {
|
||||
we = i;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (ws < 0) ws = i;
|
||||
if (!c.isDigit()) {
|
||||
we = i;
|
||||
break;
|
||||
}
|
||||
if (we >= 0) break;
|
||||
}
|
||||
}
|
||||
ret = mid(ws, we - ws);
|
||||
cutLeft(we < 0 ? sz : we);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
//! \~\details
|
||||
//! \~english "shield" symbol prevent analysis of the next symbol
|
||||
//! \~russian Символ "shield" экранирует следующий символ
|
||||
|
||||
Reference in New Issue
Block a user