KJS::Value Class Reference
Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents. More...
#include <value.h>
Inheritance diagram for KJS::Value:


Public Member Functions | |
Value () | |
Value (ValueImp *v) | |
Value (const Value &v) | |
~Value () | |
Value & | operator= (const Value &v) |
bool | isValid () const |
bool | isNull () const |
ValueImp * | imp () const |
Type | type () const |
bool | isA (Type t) const |
Value | toPrimitive (ExecState *exec, Type preferredType=UnspecifiedType) const |
bool | toBoolean (ExecState *exec) const |
double | toNumber (ExecState *exec) const |
int | toInteger (ExecState *exec) const |
int | toInt32 (ExecState *exec) const |
unsigned int | toUInt32 (ExecState *exec) const |
unsigned short | toUInt16 (ExecState *exec) const |
UString | toString (ExecState *exec) const |
Object | toObject (ExecState *exec) const |
bool | toUInt32 (unsigned &i) const |
Protected Attributes | |
ValueImp * | rep |
Detailed Description
Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents.Instead of using ValueImps (and derivatives) during normal program execution, you should use a Value-derived class.
Value maintains a pointer to a ValueImp object and uses a reference counting scheme to ensure that the ValueImp object is not deleted or garbage collected.
Note: The conversion operations all return values of various types - if an error occurs during conversion, an error object will instead be returned (where possible), and the execution state's exception will be set appropriately.
Definition at line 169 of file value.h.
Member Function Documentation
|
Returns whether or not this is a valid value. An invalid value has a 0 implementation pointer and should not be used for any other operation than this check. Current use: as a distinct return value signalling failing dynamicCast() calls. Definition at line 183 of file value.h. Referenced by KJS::StringProtoFuncImp::call(), KJS::RegExpProtoFuncImp::call(), KJS::ObjectProtoFuncImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::BooleanProtoFuncImp::call(), KJS::ObjectObjectImp::construct(), KJS::ContextImp::ContextImp(), KJS::String::dynamicCast(), KJS::Boolean::dynamicCast(), KJS::Null::dynamicCast(), KJS::Undefined::dynamicCast(), KJS::Object::dynamicCast(), KJS::InterpreterImp::evaluate(), KJS::AccessorNode2::evaluateReference(), KJS::SourceElementsNode::execute(), KJS::ObjectImp::get(), KJS::ArgumentsImp::get(), KJS::ExecState::hadException(), KJS::printInfo(), KJS::ArgumentsImp::put(), and KJS::ExecState::setException(). |
|
Definition at line 188 of file value.h. Referenced by KJS::Number::dynamicCast(), KJS::ObjectImp::get(), KJS::Reference::getValue(), KJS::ObjectImp::hasProperty(), and KJS::ObjectImp::put(). |
|
Returns the type of value. This is one of UndefinedType, NullType, BooleanType, StringType, NumberType, or ObjectType.
Definition at line 197 of file value.h. Referenced by KJS::add(), KJS::StringProtoFuncImp::call(), KJS::ObjectObjectImp::call(), KJS::GlobalFuncImp::call(), KJS::ErrorProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::ObjectObjectImp::construct(), KJS::DeclaredFunctionImp::construct(), KJS::ObjectImp::defaultValue(), KJS::Reference::deleteValue(), KJS::Number::dynamicCast(), KJS::String::dynamicCast(), KJS::Boolean::dynamicCast(), KJS::Null::dynamicCast(), KJS::Undefined::dynamicCast(), KJS::Object::dynamicCast(), KJS::equal(), KJS::TypeOfNode::evaluate(), KJS::FunctionCallNode::evaluate(), KJS::NewExprNode::evaluate(), KJS::Reference::getValue(), KJS::InternalFunctionImp::hasInstance(), KJS::printInfo(), KJS::Reference::putValue(), KJS::relation(), and KJS::strictEqual(). |
|
Checks whether or not the value is of a particular tpye.
Definition at line 205 of file value.h. Referenced by KJS::StringProtoFuncImp::call(), KJS::ObjectProtoFuncImp::call(), KJS::NumberProtoFuncImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::RegExpObjectImp::construct(), KJS::DateObjectImp::construct(), KJS::InterpreterImp::evaluate(), KJS::AccessorNode2::evaluateReference(), and KJS::AccessorNode1::evaluateReference(). |
|
Performs the ToPrimitive type conversion operation on this value (ECMA 9.1).
Definition at line 211 of file value.h. Referenced by KJS::add(), KJS::equal(), and KJS::relation(). |
|
Performs the ToBoolean type conversion operation on this value (ECMA 9.2).
Definition at line 218 of file value.h. Referenced by KJS::StringProtoFuncImp::call(), KJS::RegExpProtoFuncImp::call(), KJS::BooleanProtoFuncImp::call(), KJS::equal(), KJS::BinaryLogicalNode::evaluate(), KJS::strictEqual(), and KJS::Node::toBoolean(). |
|
Performs the ToNumber type conversion operation on this value (ECMA 9.3).
Definition at line 223 of file value.h. Referenced by KJS::add(), KJS::StringProtoFuncImp::call(), KJS::NumberProtoFuncImp::call(), KJS::DateProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::DateObjectImp::construct(), KJS::equal(), KJS::AssignNode::evaluate(), KJS::NegateNode::evaluate(), KJS::UnaryPlusNode::evaluate(), KJS::PrefixNode::evaluate(), KJS::PostfixNode::evaluate(), KJS::mult(), KJS::ArrayInstanceImp::put(), KJS::relation(), KJS::roundValue(), KJS::strictEqual(), KJS::ObjectImp::toNumber(), and KJS::Node::toNumber(). |
|
Performs the ToInteger type conversion operation on this value (ECMA 9.4).
Definition at line 228 of file value.h. Referenced by KJS::StringProtoFuncImp::call(), and KJS::NumberProtoFuncImp::call(). |
|
Performs the ToInt32 type conversion operation on this value (ECMA 9.5).
Definition at line 233 of file value.h. Referenced by KJS::RegExpProtoFuncImp::call(), KJS::AssignNode::evaluate(), KJS::BitOperNode::evaluate(), KJS::ShiftNode::evaluate(), KJS::BitwiseNotNode::evaluate(), and KJS::ArrayNode::evaluate(). |
|
Performs the ToUInt32 type conversion operation on this value (ECMA 9.6).
Definition at line 238 of file value.h. Referenced by KJS::StringProtoFuncImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::AssignNode::evaluate(), KJS::ShiftNode::evaluate(), KJS::printInfo(), and KJS::ArrayInstanceImp::put(). |
|
Performs the ToUInt16 type conversion operation on this value (ECMA 9.7).
|
|
Performs the ToString type conversion operation on this value (ECMA 9.8).
Definition at line 248 of file value.h. Referenced by KJS::add(), KJS::StringObjectImp::call(), KJS::StringProtoFuncImp::call(), KJS::RegExpProtoFuncImp::call(), KJS::NumberProtoFuncImp::call(), KJS::GlobalFuncImp::call(), KJS::ErrorProtoFuncImp::call(), KJS::BooleanProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::RegExpObjectImp::construct(), KJS::DateObjectImp::construct(), KJS::equal(), KJS::RelationalNode::evaluate(), KJS::PropertyValueNode::evaluate(), KJS::StringInstanceImp::get(), KJS::printInfo(), KJS::StringInstanceImp::propList(), KJS::relation(), KJS::strictEqual(), KJS::Node::throwError(), KJS::ObjectImp::toString(), and KJS::Node::toString(). |
|
Performs the ToObject type conversion operation on this value (ECMA 9.9).
Definition at line 357 of file object.h. References KJS::ValueImp::dispatchToObject(), and rep. Referenced by KJS::StringProtoFuncImp::call(), KJS::ObjectObjectImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::RegExpObjectImp::construct(), KJS::ObjectObjectImp::construct(), KJS::InterpreterImp::evaluate(), KJS::AccessorNode2::evaluateReference(), KJS::AccessorNode1::evaluateReference(), and KJS::WithNode::execute(). |
|
Checks if we can do a lossless conversion to UInt32.
|
The documentation for this class was generated from the following files: