mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-30 14:28:50 +01:00
Change token to use 64-bit integers by default (when available)
This commit is contained in:
parent
25811d4c64
commit
27616fb0e6
@ -105,8 +105,13 @@ public:
|
|||||||
virtual std::string asString() const;
|
virtual std::string asString() const;
|
||||||
/// Returns a string representation of the token.
|
/// 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;
|
virtual int asInteger() const;
|
||||||
/// Returns an integer representation of the token.
|
/// Returns an integer representation of the token.
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual double asFloat() const;
|
virtual double asFloat() const;
|
||||||
/// Returns a floating-point representation of the token.
|
/// Returns a floating-point representation of the token.
|
||||||
|
@ -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
|
int Token::asInteger() const
|
||||||
{
|
{
|
||||||
return NumberParser::parse(_value);
|
return NumberParser::parse(_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
double Token::asFloat() const
|
double Token::asFloat() const
|
||||||
{
|
{
|
||||||
return NumberParser::parseFloat(_value);
|
return NumberParser::parseFloat(_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user