.TH "KJS::Value" kde3 "11 Jun 2005" "Version Version 3.4.1" "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::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
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.ti -1c
.RI "\fBValueImp\fP * \fBimp\fP () const "
.br
.ti -1c
.RI "Type \fBtype\fP () const "
.br
.ti -1c
.RI "bool \fBisA\fP (Type t) const "
.br
.ti -1c
.RI "\fBValue\fP \fBtoPrimitive\fP (\fBExecState\fP *exec, Type preferredType=UnspecifiedType) const "
.br
.ti -1c
.RI "bool \fBtoBoolean\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "double \fBtoNumber\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "int \fBtoInteger\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "int \fBtoInt32\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "unsigned int \fBtoUInt32\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "unsigned short \fBtoUInt16\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "\fBUString\fP \fBtoString\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "\fBObject\fP \fBtoObject\fP (\fBExecState\fP *exec) const "
.br
.ti -1c
.RI "bool \fBtoUInt32\fP (unsigned &i) const "
.br
.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 169 of file value.h.
.SH "Member Function Documentation"
.PP 
.SS "bool KJS::Value::isValid () const\fC [inline]\fP"
.PP
Returns whether or not this is a valid value. 
.PP
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. 
.PP
Definition at line 183 of file value.h.
.SS "bool KJS::Value::isNull () const\fC [inline]\fP"
.PP
\fBDeprecated\fP
.RS 4
Use !isValid() instead. 
.RE
.PP

.PP
Definition at line 188 of file value.h.
.PP
Referenced by KJS::Reference::getValue().
.SS "Type KJS::Value::type () const\fC [inline]\fP"
.PP
Returns the type of value. 
.PP
This is one of UndefinedType, NullType, BooleanType, StringType, NumberType, or ObjectType.
.PP
\fBReturns:\fP
.RS 4
The type of value 
.RE
.PP

.PP
Definition at line 197 of file value.h.
.PP
Referenced by KJS::Reference::getValue(), and KJS::Reference::putValue().
.SS "bool KJS::Value::isA (Type t) const\fC [inline]\fP"
.PP
Checks whether or not the value is of a particular tpye. 
.PP
\fBParameters:\fP
.RS 4
\fIt\fP The type to compare with 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the value is of the specified type, otherwise false 
.RE
.PP

.PP
Definition at line 205 of file value.h.
.SS "\fBValue\fP KJS::Value::toPrimitive (\fBExecState\fP * exec, Type preferredType = \fCUnspecifiedType\fP) const\fC [inline]\fP"
.PP
Performs the ToPrimitive type conversion operation on this value (ECMA 9.1). 
.PP
Definition at line 211 of file value.h.
.SS "bool KJS::Value::toBoolean (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToBoolean type conversion operation on this value (ECMA 9.2). 
.PP
Definition at line 218 of file value.h.
.SS "double KJS::Value::toNumber (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToNumber type conversion operation on this value (ECMA 9.3). 
.PP
Definition at line 223 of file value.h.
.SS "int KJS::Value::toInteger (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToInteger type conversion operation on this value (ECMA 9.4). 
.PP
Definition at line 228 of file value.h.
.SS "int KJS::Value::toInt32 (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToInt32 type conversion operation on this value (ECMA 9.5). 
.PP
Definition at line 233 of file value.h.
.SS "unsigned int KJS::Value::toUInt32 (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToUInt32 type conversion operation on this value (ECMA 9.6). 
.PP
Definition at line 238 of file value.h.
.SS "unsigned short KJS::Value::toUInt16 (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToUInt16 type conversion operation on this value (ECMA 9.7). 
.PP
Definition at line 243 of file value.h.
.SS "\fBUString\fP KJS::Value::toString (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToString type conversion operation on this value (ECMA 9.8). 
.PP
Definition at line 248 of file value.h.
.SS "\fBObject\fP KJS::Value::toObject (\fBExecState\fP * exec) const\fC [inline]\fP"
.PP
Performs the ToObject type conversion operation on this value (ECMA 9.9). 
.PP
Definition at line 357 of file object.h.
.PP
References KJS::ValueImp::dispatchToObject().
.SS "bool KJS::Value::toUInt32 (unsigned & i) const\fC [inline]\fP"
.PP
Checks if we can do a lossless conversion to UInt32. 
.PP
Definition at line 258 of file value.h.

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