Adapt getAs function to proper naming scheme.

This commit is contained in:
Markus Groß
2012-07-03 18:42:04 +02:00
parent f8feaf6ea8
commit 935276fccd

View File

@@ -300,7 +300,7 @@ namespace chaiscript
}
template<typename Target, typename Source>
Target getAsAux()
Target get_as_aux()
{
return static_cast<Target>(*static_cast<const Source *>(bv.get_const_ptr()));
}
@@ -332,42 +332,42 @@ namespace chaiscript
validate_boxed_number(bv);
}
template<typename Target> Target getAs()
template<typename Target> Target get_as()
{
const Type_Info &inp_ = bv.get_type_info();
if (inp_ == typeid(int)) {
return getAsAux<Target, int>();
return get_as_aux<Target, int>();
} else if (inp_ == typeid(double)) {
return getAsAux<Target, double>();
return get_as_aux<Target, double>();
} else if (inp_ == typeid(float)) {
return getAsAux<Target, float>();
return get_as_aux<Target, float>();
} else if (inp_ == typeid(long double)) {
return getAsAux<Target, long double>();
return get_as_aux<Target, long double>();
} else if (inp_ == typeid(char)) {
return getAsAux<Target, char>();
return get_as_aux<Target, char>();
} else if (inp_ == typeid(unsigned int)) {
return getAsAux<Target, unsigned int>();
return get_as_aux<Target, unsigned int>();
} else if (inp_ == typeid(long)) {
return getAsAux<Target, long>();
return get_as_aux<Target, long>();
} else if (inp_ == typeid(unsigned long)) {
return getAsAux<Target, unsigned long>();
return get_as_aux<Target, unsigned long>();
} else if (inp_ == typeid(boost::int8_t)) {
return getAsAux<Target, boost::int8_t>();
return get_as_aux<Target, boost::int8_t>();
} else if (inp_ == typeid(boost::int16_t)) {
return getAsAux<Target, boost::int16_t>();
return get_as_aux<Target, boost::int16_t>();
} else if (inp_ == typeid(boost::int32_t)) {
return getAsAux<Target, boost::int32_t>();
return get_as_aux<Target, boost::int32_t>();
} else if (inp_ == typeid(boost::int64_t)) {
return getAsAux<Target, boost::int64_t>();
return get_as_aux<Target, boost::int64_t>();
} else if (inp_ == typeid(boost::uint8_t)) {
return getAsAux<Target, boost::uint8_t>();
return get_as_aux<Target, boost::uint8_t>();
} else if (inp_ == typeid(boost::uint16_t)) {
return getAsAux<Target, boost::uint16_t>();
return get_as_aux<Target, boost::uint16_t>();
} else if (inp_ == typeid(boost::uint32_t)) {
return getAsAux<Target, boost::uint32_t>();
return get_as_aux<Target, boost::uint32_t>();
} else if (inp_ == typeid(boost::uint64_t)) {
return getAsAux<Target, boost::uint64_t>();
return get_as_aux<Target, boost::uint64_t>();
} else {
throw boost::bad_any_cast();
}