src/NFfunction/muParser/muParser.cpp
//---------------------------------------------------------------------------
/** \brief Default value recognition callback. 
      \param [in] a_szExpr Pointer to the expression
      \param [in, out] a_iPos Pointer to an index storing the current position within the expression
      \param [out] a_fVal Pointer where the value should be stored in case one is found.
      \return 1 if a value was found 0 otherwise.
  */
\brief Default value recognition callback.
\param [in] a_szExpr Pointer to the expression
\param [in, out] a_iPos Pointer to an index storing the current position within the expression
\param [out] a_fVal Pointer where the value should be stored in case one is found.
\return 1 if a value was found 0 otherwise.
\ brief Default value recognition callback . \ param [ in ] a_szExpr Pointer to the expression \ param [ in out ] a_iPos Pointer to an index storing the current position within the expression \ param [ out ] a_fVal Pointer where the value should be stored in case one is found . \ return 1 if a value was found 0 otherwise .
int Parser::IsVal(const char_type* a_szExpr, int *a_iPos, value_type *a_fVal)
  {
    value_type fVal(0);
  //
    stringstream_type stream(a_szExpr);
    stream.seekg(0);        
    stream.imbue(Parser::s_locale);
    stream >> fVal;
    int iEnd = stream.tellg(); 
    if (iEnd==-1)
      return 0;
    *a_iPos += iEnd;
    *a_fVal = fVal;
    return 1;
  }
int Parser :: IsVal ( const char_type * a_szExpr , int * a_iPos , value_type * a_fVal ) { value_type fVal ( 0 ) ; stringstream_type stream ( a_szExpr ) ; stream . seekg ( 0 ) ; stream . imbue ( Parser :: s_locale ) ; stream >> fVal ; int iEnd = stream . tellg ( ) ; if ( iEnd == -1 ) return 0 ; * a_iPos += iEnd ; * a_fVal = fVal ; return 1 ; }
\brief Default value recognition callback.
\ brief Default value recognition callback .
// 20080309 commented the fix since it is not local aware
 //
 //// thanks to CodeProject member sailorickm for writing this fix:
 //// http://www.codeproject.com/cpp/FastMathParser.asp?msg=1354598#xx1354598xx
 //// i cant test it myself, if you see problems please contact me.
 ////
 //// - 20080309 ibg; support for locales wont work with this fix
 //#if defined (__hpux) || (defined __GNUC__ && (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 )))
 //  int iEnd = 0;
 //  int nAssigned = sscanf(a_szExpr, "%lf%n", &fVal, &iEnd);
 //  if (nAssigned == 0)
 //  iEnd = -1;
 //#else
 // todo:  check if this really is necessary
 // Position after reading
 //#endif
