Splits an input string into a series of strings on the basis of a single delimiting char. Returns: None

Return TypeFunction nameArguments
voidSplitStrOnChar(hzArray<hzString>&,hzString&,char,)

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

Function Logic:

0:START 1:items 2:unknown 3:unknown 4:cDelim 5:i nPos nRef 6:unknown 7:unknown 8:S 9:unknown 10:items 11:unknown 12:nPos 13:nRef 14:items 15: No text

Function body:

void SplitStrOnChar (hzArray<hzString>& ar)hzString& input, char cDelim, 
{
   //  Category: Text Processing
   //  
   //  Splits an input string into a series of strings on the basis of a single delimiting char.
   //  
   //  Arguments: 1) ar  The vector of strings that will be populated by this operation (note it is first cleared)
   //     2) input The input string or chain
   //     3) cDelim The delimitor (default of comma)
   //  
   //  Returns: None
   const char* i ;         //  Input iterator
   hzString    S ;         //  Substring of input
   uint32_t    nRef = 0;   //  Substring end position (within input)
   uint32_t    nPos = 0;   //  Substring start position (within input)
   ar.Clear() ;
   if (input)
   {
       if (!cDelim)
           cDelim = 0;
       i = *input ;
       nRef = nPos = 0;
       for (;;)
       {
           if (i[nPos] == 0|| i[nPos] == cDelim)
           {
               S = input.SubString(nRef, nPos - nRef) ;
               if (S)
                   ar.Add(S) ;
               if (i[nPos] == 0)
                   break ;
               nRef = nPos + 1;
           }
           nPos++ ;
       }
   }
}