Replaces escape sequences with the real vales. Eg "Hello\nWorld" will have the '\n' replaced by the ASCII value for a newline. Handles \r, \t

Return TypeFunction nameArguments
hzStringDeEscape(hzString&,)

Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp

Function Logic:

0:START 1:unknown 2:Return result 3:buf 4:j 5:unknown 6:unknown 7:items 8:unknown 9:* 10:unknown 11:* 12:unknown 13:* 14:unknown 15:* 16:unknown 17:* 18:unknown 19:* 20:unknown 21:* 22:items 23:unknown 24:items 25:unknown 26:* 27:( 28:* 29:items 30:* 31:* result buf 32:Return result

Function body:

hzString DeEscape (hzString& x)
{
   //  Category: Text Processing
   //  
   //  Replaces escape sequences with the real vales. Eg "Hello\nWorld" will have the '\n' replaced by the ASCII value for a newline. Handles \r, \t
   //  
   //  Arguments: 1) x Input string
   //  
   //  Returns: Instance of hzString by value being the unescaped translation of the supplied string
   _hzfunc(__func__) ;
   char*       buf ;       //  Working buffer
   char*       j ;         //  Working buffer iterator
   const char* i ;         //  Input string iterator
   hzString    result ;    //  Output string
   if (!x.Length())
       return result ;
   j = buf = new char[x.Length() + 1];
   for (i = *x ; *i ; i++)
   {
       if (*i == CHAR_BKSLASH)
       {
           i++ ;
           if (*i == ''r''){ *j++ = CHAR_CR ; continue ; }
           if (*i == ''n''){ *j++ = CHAR_NL ; continue ; }
           if (*i == ''t''){ *j++ = CHAR_TAB ; continue ; }
           if (*i == ''v''){ *j++ = CHAR_CTRLI ; continue ; }
           if (*i == ''f''){ *j++ = CHAR_CTRLL ; continue ; }
           if (*i == ''"''){*j++=CHAR_DQUOTE;continue ; }
           if (*i == CHAR_BKSLASH)
               { *j++ = CHAR_BKSLASH ; continue ; }
           i-- ;
       }
       if (*i == CHAR_HAT)
       {
           i++ ;
           if (*i >&eq; ''A''&&*i <&eq; ''Z'')
               { *j++ = ((*i - ''A'')+1); continue ; }
           i-- ;
       }
       *j++ = *i ;
   }
   *j = 0;
   result = buf ;
   delete buf ;
   return result ;
}