.TH "KJS::Value" 3 "28 Jan 2004" "kjs Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJS::Value \- \fBValue\fP objects are act as wrappers ('smart pointers') around \fBValueImp\fP objects and their descendents.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <value.h>\fP
.PP
Inherited by \fBKJS::Boolean\fP, \fBKJS::Completion\fP, \fBKJS::List\fP, \fBKJS::Null\fP, \fBKJS::Number\fP, \fBKJS::Object\fP, \fBKJS::Reference\fP, \fBKJS::String\fP, and \fBKJS::Undefined\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBValue\fP (\fBValueImp\fP *v)"
.br
.ti -1c
.RI "\fBValue\fP (const  \fBValue\fP &v)"
.br
.ti -1c
.RI "\fBValue\fP & \fBoperator=\fP (const  \fBValue\fP &v)"
.br
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.RI "\fIReturns whether or not this is a valid value. \fP"
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Use !isValid() instead. \fP"
.ti -1c
.RI "\fBValueImp\fP * \fBimp\fP () const "
.br
.ti -1c
.RI "Type \fBtype\fP () const "
.br
.RI "\fIReturns the type of value. \fP"
.ti -1c
.RI "bool \fBisA\fP (Type t) const "
.br
.RI "\fIChecks whether or not the value is of a particular tpye. \fP"
.ti -1c
.RI "\fBValue\fP \fBtoPrimitive\fP (\fBExecState\fP *exec, Type preferredType=UnspecifiedType) const "
.br
.RI "\fIPerforms the ToPrimitive type conversion operation on this value (ECMA 9.1). \fP"
.ti -1c
.RI "bool \fBtoBoolean\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToBoolean type conversion operation on this value (ECMA 9.2). \fP"
.ti -1c
.RI "double \fBtoNumber\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToNumber type conversion operation on this value (ECMA 9.3). \fP"
.ti -1c
.RI "int \fBtoInteger\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToInteger type conversion operation on this value (ECMA 9.4). \fP"
.ti -1c
.RI "int \fBtoInt32\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToInt32 type conversion operation on this value (ECMA 9.5). \fP"
.ti -1c
.RI "unsigned int \fBtoUInt32\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToUint32 type conversion operation on this value (ECMA 9.6). \fP"
.ti -1c
.RI "unsigned short \fBtoUInt16\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToUint16 type conversion operation on this value (ECMA 9.7). \fP"
.ti -1c
.RI "\fBUString\fP \fBtoString\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToString type conversion operation on this value (ECMA 9.8). \fP"
.ti -1c
.RI "\fBObject\fP \fBtoObject\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the ToObject type conversion operation on this value (ECMA 9.9). \fP"
.ti -1c
.RI "\fBValue\fP \fBgetBase\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the GetBase type conversion operation on this value (ECMA 8.7). \fP"
.ti -1c
.RI "\fBUString\fP \fBgetPropertyName\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the GetPropertyName type conversion operation on this value (ECMA 8.7). \fP"
.ti -1c
.RI "\fBValue\fP \fBgetValue\fP (\fBExecState\fP *exec) const "
.br
.RI "\fIPerforms the GetValue type conversion operation on this value (ECMA 8.7.1). \fP"
.ti -1c
.RI "void \fBputValue\fP (\fBExecState\fP *exec, const  \fBValue\fP w)"
.br
.RI "\fIPerforms the PutValue type conversion operation on this value (ECMA 8.7.1). \fP"
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBValueImp\fP * \fBrep\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBValue\fP objects are act as wrappers ('smart pointers') around \fBValueImp\fP objects and their descendents. 

Instead of using ValueImps (and derivatives) during normal program execution, you should use a Value-derived class.
.PP
\fBValue\fP maintains a pointer to a \fBValueImp\fP object and uses a reference counting scheme to ensure that the \fBValueImp\fP object is not deleted or garbage collected.
.PP
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. 
.PP
Definition at line 156 of file value.h.
.SH "Member Function Documentation"
.PP 
.SS "bool Value::isValid () const"
.PP
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 219 of file value.cpp.
.SS "bool Value::isNull () const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Use !isValid() instead. Definition at line 224 of file value.cpp.
.PP
Referenced by KJS::Number::dynamicCast(), KJS::String::dynamicCast(), KJS::Boolean::dynamicCast(), KJS::Null::dynamicCast(), KJS::Undefined::dynamicCast(), KJS::Completion::dynamicCast(), KJS::List::dynamicCast(), and KJS::Object::dynamicCast().
.SS "Type Value::type () const"
.PP
Returns the type of value. This is one of UndefinedType, NullType, BooleanType, StringType NumberType, ObjectType, ReferenceType, ListType or CompletionType.
.PP
\fBReturns:\fP
.RS 4
The type of value 
.RE
.PP
Definition at line 234 of file value.cpp.
.PP
References KJS::ValueImp::type().
.PP
Referenced by KJS::Number::dynamicCast(), KJS::String::dynamicCast(), KJS::Boolean::dynamicCast(), KJS::Null::dynamicCast(), KJS::Undefined::dynamicCast(), KJS::Completion::dynamicCast(), KJS::List::dynamicCast(), KJS::Object::dynamicCast(), and isA().
.SS "bool Value::isA (Type t) const"
.PP
Checks whether or not the value is of a particular tpye. \fBParameters:\fP
.RS 4
\fIThe\fP type to compare with 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the value is of the specified type, otherwise false 
.RE
.PP
Definition at line 239 of file value.cpp.
.PP
References type().
.SS "\fBValue\fP Value::toPrimitive (\fBExecState\fP * exec, Type preferredType = UnspecifiedType) const"
.PP
Performs the ToPrimitive type conversion operation on this value (ECMA 9.1). Definition at line 244 of file value.cpp.
.PP
References KJS::ValueImp::toPrimitive().
.SS "bool Value::toBoolean (\fBExecState\fP * exec) const"
.PP
Performs the ToBoolean type conversion operation on this value (ECMA 9.2). Definition at line 249 of file value.cpp.
.PP
References KJS::ValueImp::toBoolean().
.SS "double Value::toNumber (\fBExecState\fP * exec) const"
.PP
Performs the ToNumber type conversion operation on this value (ECMA 9.3). Definition at line 254 of file value.cpp.
.PP
References KJS::ValueImp::toNumber().
.SS "int Value::toInteger (\fBExecState\fP * exec) const"
.PP
Performs the ToInteger type conversion operation on this value (ECMA 9.4). Definition at line 259 of file value.cpp.
.PP
References KJS::ValueImp::toInteger().
.SS "int Value::toInt32 (\fBExecState\fP * exec) const"
.PP
Performs the ToInt32 type conversion operation on this value (ECMA 9.5). Definition at line 264 of file value.cpp.
.PP
References KJS::ValueImp::toInt32().
.SS "unsigned int Value::toUInt32 (\fBExecState\fP * exec) const"
.PP
Performs the ToUint32 type conversion operation on this value (ECMA 9.6). Definition at line 269 of file value.cpp.
.PP
References KJS::ValueImp::toUInt32().
.SS "unsigned short Value::toUInt16 (\fBExecState\fP * exec) const"
.PP
Performs the ToUint16 type conversion operation on this value (ECMA 9.7). Definition at line 274 of file value.cpp.
.PP
References KJS::ValueImp::toUInt16().
.SS "\fBUString\fP Value::toString (\fBExecState\fP * exec) const"
.PP
Performs the ToString type conversion operation on this value (ECMA 9.8). Definition at line 279 of file value.cpp.
.PP
References KJS::ValueImp::toString().
.SS "\fBObject\fP Value::toObject (\fBExecState\fP * exec) const"
.PP
Performs the ToObject type conversion operation on this value (ECMA 9.9). Definition at line 284 of file value.cpp.
.PP
References KJS::ValueImp::toObject().
.SS "\fBValue\fP Value::getBase (\fBExecState\fP * exec) const"
.PP
Performs the GetBase type conversion operation on this value (ECMA 8.7). Since references are supposed to have an \fBObject\fP or null as their base, this method is guaranteed to return either Null() or an \fBObject\fP value. Definition at line 290 of file value.cpp.
.PP
References KJS::ValueImp::getBase().
.SS "\fBUString\fP Value::getPropertyName (\fBExecState\fP * exec) const"
.PP
Performs the GetPropertyName type conversion operation on this value (ECMA 8.7). Definition at line 296 of file value.cpp.
.PP
References KJS::ValueImp::getPropertyName().
.SS "\fBValue\fP Value::getValue (\fBExecState\fP * exec) const"
.PP
Performs the GetValue type conversion operation on this value (ECMA 8.7.1). Definition at line 302 of file value.cpp.
.PP
References KJS::ValueImp::getValue().
.SS "void Value::putValue (\fBExecState\fP * exec, const \fBValue\fP w)"
.PP
Performs the PutValue type conversion operation on this value (ECMA 8.7.1). Definition at line 308 of file value.cpp.
.PP
References KJS::ValueImp::putValue().

.SH "Author"
.PP 
Generated automatically by Doxygen for kjs Library from the source code.
