Logo Search packages:      
Sourcecode: yate version File versions  Download package

int String::toInteger ( const TokenDict tokens,
int  defvalue = 0,
int  base = 0 
) const

Convert the string to an integer value looking up first a token table.

Parameters:
tokens Pointer to an array of tokens to lookup first
defvalue Default to return if the string is not a token or number
base Numeration base, 0 to autodetect
Returns:
The integer interpretation or defvalue.

Definition at line 331 of file String.cpp.

References toInteger(), TelEngine::TokenDict::token, and TelEngine::TokenDict::value.

{
    if (!m_string)
      return defvalue;
    if (tokens) {
      for (; tokens->token; tokens++)
          if (operator==(tokens->token))
            return tokens->value;
    }
    return toInteger(defvalue,base);
}


Generated by  Doxygen 1.6.0   Back to index