Change token to use 64-bit integers by default (when available)

This commit is contained in:
Mike Naquin 2012-12-13 09:39:23 -06:00
parent 25811d4c64
commit 27616fb0e6
2 changed files with 20 additions and 0 deletions

View File

@ -105,8 +105,13 @@ public:
virtual std::string asString() const;
/// Returns a string representation of the token.
#if defined(POCO_HAVE_INT64)
virtual Int64 asInteger() const;
/// Returns a 64-bit integer representation of the token.
#else
virtual int asInteger() const;
/// Returns an integer representation of the token.
#endif
virtual double asFloat() const;
/// Returns a floating-point representation of the token.

View File

@ -76,12 +76,27 @@ std::string Token::asString() const
}
#if defined(POCO_HAVE_INT64)
Int64 Token::asInteger() const
{
return NumberParser::parse64(_value);
}
#else
int Token::asInteger() const
{
return NumberParser::parse(_value);
}
#endif
double Token::asFloat() const
{
return NumberParser::parseFloat(_value);