Populate supplied vector of tokens (arg 1) by tokenizing the supplied file (named in arg 2) according to the modus operandi specified by arg 3

Return TypeFunction nameArguments
hzEcodeTokenizeFile(hzVect<hzToken>&,const char*,hzTokMode,)

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

Function Logic:

0:START 1:unknown 2:items 3:Return E_ARGUMENT 4:unknown 5:items 6:Return E_ARGUMENT 7:items 8:unknown 9:items 10:Return E_OPENFAIL 11:items items 12:eMode 13:TOK_MO_WHITE 14:Return TokenizeWords(toks,C) 15:TOK_MO_FTEXT 16:Return TokenizeFreetext(toks,C) 17:TOK_MO_BOOL 18:Return TokenizeBool(toks,C) 19:Return E_RANGE

Function body:

hzEcode TokenizeFile (hzVect<hzToken>& toks)const char* fname, hzTokMode eMode, 
{
   //  Category: Text Processing
   //  
   //  Populate supplied vector of tokens (arg 1) by tokenizing the supplied file (named in arg 2) according to the modus operandi specified by
   //  arg 3
   //  
   //  Arguments: 1) toks The vector of tokens found in the input
   //     2) fname The input filename
   //     3) eMode The tokenization regime (either WHITE, FTEXT or BOOL)
   //  
   //  Returns: E_NODATA If the supplied chain is empty
   //     E_RANGE  If the supplied mode is invalid
   //     E_OK  If the supplied chain is tokenized
   _hzfunc("TokenizeFile") ;
   /*
   **  ** Convert file into tokens
   **      */
   std::ifstream   is ;    //  Input stream
   FSTAT           fs ;    //  File status
   hzChain         C ;     //  Working chain
   if (!fname || !fname[0])
   {
       hzerr(E_ARGUMENT, "Cannot tokenize unnamed file") ;
       return E_ARGUMENT ;
   }
   if (stat(fname, &fs) == -1)
   {
       hzerr(E_ARGUMENT, "File (%s) does not exist") ;
       return E_ARGUMENT ;
   }
   is.open(fname) ;
   if (is.fail())
   {
       hzerr(E_OPENFAIL, "File %s", fname) ;
       return E_OPENFAIL ;
   }
   C << is ;
   is.close() ;
   switch  (eMode)
   {
   case TOK_MO_WHITE:  return TokenizeWords(toks, C) ;
   case TOK_MO_FTEXT:  return TokenizeFreetext(toks, C) ;
   case TOK_MO_BOOL:   return TokenizeBool(toks, C) ;
   }
   return E_RANGE ;
}