virtual AColor toColor() const { AColor c = parse_acolor(value); if (!c.Ok()) { throw ScriptErrorConversion(value, typeName(), _TYPE_("color")); } return c; }
virtual wxDateTime toDateTime() const { wxDateTime date; wxString::const_iterator end; if (!date.ParseDateTime(value, &end)) { throw ScriptErrorConversion(value, typeName(), _TYPE_("date")); } return date; }
virtual int toInt() const { long l; if (value.ToLong(&l)) { return l; } else { throw ScriptErrorConversion(value, typeName(), _TYPE_("integer")); } }
virtual double toDouble() const { double d; if (value.ToDouble(&d)) { return d; } else { throw ScriptErrorConversion(value, typeName(), _TYPE_("double")); } }
virtual bool toBool() const { if (value == _("yes") || value == _("true")) { return true; } else if (value == _("no") || value == _("false") || value.empty()) { return false; } else { throw ScriptErrorConversion(value, typeName(), _TYPE_("boolean")); } }
virtual wxDateTime toDateTime() const { wxDateTime date; wxString::const_iterator *end; bool ret = date.ParseDateTime(value.c_str(), end); if (!ret) { throw ScriptErrorConversion(value, typeName(), _TYPE_("date")); } return date; }
int ScriptValue::itemCount() const { throw ScriptErrorConversion(typeName(), _TYPE_("collection")); }
ScriptValueP ScriptValue::makeIterator() const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("collection"))); }
ScriptValueP ScriptValue::do_eval(Context&, bool) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("function"))); }
GeneratedImageP ScriptValue::toImage() const { throw ScriptErrorConversion(typeName(), _TYPE_("image" )); }
wxDateTime ScriptValue::toDateTime() const { throw ScriptErrorConversion(typeName(), _TYPE_("date" )); }
AColor ScriptValue::toColor() const { throw ScriptErrorConversion(typeName(), _TYPE_("color" )); }
double ScriptValue::toDouble() const { throw ScriptErrorConversion(typeName(), _TYPE_("double" )); }
bool ScriptValue::toBool() const { throw ScriptErrorConversion(typeName(), _TYPE_("boolean" )); }
int ScriptValue::toInt() const { throw ScriptErrorConversion(typeName(), _TYPE_("integer" )); }
String ScriptValue::toString() const { throw ScriptErrorConversion(typeName(), _TYPE_("string" )); }