19 #ifndef GNASH_AS_VALUE_H
20 #define GNASH_AS_VALUE_H
27 #include <boost/variant.hpp>
29 #include <boost/type_traits/is_floating_point.hpp>
30 #include <boost/utility/enable_if.hpp>
31 #include <boost/cstdint.hpp>
53 static const double NaN = std::numeric_limits<double>::quiet_NaN();
59 isNaN(
const T& num,
typename boost::enable_if<boost::is_floating_point<T> >::
70 return isNaN(num - num);
134 _value(boost::blank())
152 _value(std::string(str))
159 _value(std::string(str))
163 template <
typename T>
199 const char*
typeOf()
const;
234 std::string
to_string(
int version = 7)
const;
244 bool to_bool(
int version)
const;
357 _type =
static_cast<AsType>(
static_cast<int>(_type) + 1);
363 _type =
static_cast<AsType>(
static_cast<int>(_type) - 1);
419 typedef boost::variant<boost::blank,
428 bool operator==(
const as_value&
v)
const;
431 bool operator!=(
const as_value&
v)
const;
437 bool equalsSameType(
const as_value&
v)
const;
451 DisplayObject* getCharacter(
bool skipRebinding =
false)
const;
461 double getNum()
const {
463 return boost::get<double>(_value);
469 bool getBool()
const {
471 return boost::get<bool>(_value);
477 const std::string& getStr()
const {
479 return boost::get<std::string>(_value);
485 std::ostream&
operator<<(std::ostream& os,
const as_value&
v);
528 #endif // GNASH_AS_VALUE_H