Splits an input chain into a series of strings on the basis of a single delimiting char. .

Return TypeFunction nameArguments
voidSplitChain(hzVect<hzString>&,hzChain&,char,)

Declared and defined in file: hzTextproc.cpp

Function Logic:

0:START 1:items 2:unknown 3:unknown 4:cDelim 5:unknown 6:unknown 7:S items items 8:items 9:unknown 10:S items 11: No text

Function body:

void SplitChain (hzVect<hzString>& ar)hzChain& input, char cDelim, 
{
   //  Category: Text Processing
   //  
   //  Splits an input chain 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.
   hzChain     C ;     //  Temporary chain (for storing partial data)
   chIter      i ;     //  Itererator for input
   hzString    S ;     //  Set by temp chain upon delim
   ar.Clear() ;
   if (input.Size())
   {
       if (!cDelim)
           cDelim = CHAR_COMMA ;
       for (i = input ; !i.eof() ; i++)
       {
           if (*i == cDelim)
           {
               S = C ;
               ar.Add(S) ;
               C.Clear() ;
           }
           C.AddByte(*i) ;
       }
       if (C.Size())
       {
           S = C ;
           ar.Add(S) ;
       }
   }
}