Assumes the supplied character string pointer is the start of a hexadecimal number and reads the value. If there are 8 chars that match [0-9] or [a-f] or [A-F], true is returned and arg1 (int32_t&) is set to the hex value.

Return TypeFunction nameArguments
boolReadHex(int32_t&,const char*,)

Declared and defined in file: hzTextproc.cpp

Function Logic:

0:START 1:nVal 2:unknown 3:Return false 4:unknown 5:unknown 6:v * v 7:* 8:unknown 9:Return false 10:v v * v 11:nVal 12:Return true

Function body:

bool ReadHex (int32_t& nVal)const char* s, 
{
   //  Category: Text Processing
   //  
   //  Assumes the supplied character string pointer is the start of a hexadecimal number and reads the value. If there are 8 chars that match
   //  [0-9] or [a-f] or [A-F], true is returned and arg1 (int32_t&) is set to the hex value.
   //  
   //  Arguments: 1) nVal The int32_t reference to be populated
   //     2) s  The char string assumed to be at the start of a hex number
   //  
   //  Returns: True If the supplied cstr amounted to a hex value
   //     False Otherwise
   _hzfunc("ReadHex") ;
   char*   i = (char*) s ; //  Need this because tolower violates const
   int32_t v = 0;          //  Value being read
   int32_t n = 0;          //  Number of chars processed
   nVal = 0;
   if (!i || !i[0])
       return false ;
   for (; *i && n < 8; i++, n++)
   {
       if (chartype[*i] & CTYPE_DIGIT)
       {
           v *= 16;
           v += (*i - CHAR_0) ;
           continue ;
       }
       *i = tolower(*i) ;
       if (*i < ''a''||*i > ''f'')
           return false ;
       v *= 16;
       v += 10;
       v += (*i - ''a'');
   }
   nVal = v ;
   return true ;
}