| Return Type | Function name | Arguments |
|---|---|---|
| bool | IsPosint | (uint64_t&,const char*,) |
Declared in file: hzTextproc.h
Defined in file : hzTypes.cpp
Function Logic:
Function body:
bool IsPosint (uint64_t& nVal)const char* tok,
{
_hzfunc("IsPosint(uint64)") ;
const char* i ; // Input string iterator
uint64_t val ; // Value aggregator
uint32_t count ; // Length check
nVal = 0;
i = tok ;
if (!i || !i[0])
return false ;
// cope with + and any leading whitespace
for (; IsWhite(*i) ; i++) ;
// Reject on minus sign
if (*i == CHAR_MINUS)
return false ;
// Ignore plus sign
if (*i == ''+'')
for (i++ ; IsWhite(*i) ; i++) ;
// cope with spaces between sign and digits
for (; IsWhite(*i) ; i++) ;
val = 0;
for (count = 0; count < 21&&IsDigit(*i) ; count++, i++)
{
val *= 10;
val += (*i - CHAR_0) ;
}
// Check length limit
if (!count || count > 20)
return false ;
nVal = val ;
return true ;
}