.TH "KJS::Object" kde3 "11 Jun 2005" "Version Version 3.4.1" "kjs Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJS::Object \- Represents an \fBObject\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <object.h>\fP
.PP
Inherits \fBKJS::Value\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBObject\fP (ObjectImp *v)"
.br
.ti -1c
.RI "ObjectImp * \fBimp\fP () const "
.br
.ti -1c
.RI "const \fBClassInfo\fP * \fBclassInfo\fP () const "
.br
.ti -1c
.RI "bool \fBinherits\fP (const \fBClassInfo\fP *cinfo) const "
.br
.ti -1c
.RI "\fBValue\fP \fBprototype\fP () const "
.br
.ti -1c
.RI "\fBUString\fP \fBclassName\fP () const "
.br
.ti -1c
.RI "\fBValue\fP \fBget\fP (\fBExecState\fP *exec, const \fBIdentifier\fP &propertyName) const "
.br
.ti -1c
.RI "\fBValue\fP \fBget\fP (\fBExecState\fP *exec, unsigned propertyName) const "
.br
.ti -1c
.RI "void \fBput\fP (\fBExecState\fP *exec, const \fBIdentifier\fP &propertyName, const \fBValue\fP &value, int attr=None)"
.br
.ti -1c
.RI "void \fBput\fP (\fBExecState\fP *exec, unsigned propertyName, const \fBValue\fP &value, int attr=None)"
.br
.ti -1c
.RI "bool \fBcanPut\fP (\fBExecState\fP *exec, const \fBIdentifier\fP &propertyName) const "
.br
.ti -1c
.RI "bool \fBhasProperty\fP (\fBExecState\fP *exec, const \fBIdentifier\fP &propertyName) const "
.br
.ti -1c
.RI "bool \fBhasProperty\fP (\fBExecState\fP *exec, unsigned propertyName) const "
.br
.ti -1c
.RI "bool \fBdeleteProperty\fP (\fBExecState\fP *exec, const \fBIdentifier\fP &propertyName)"
.br
.ti -1c
.RI "bool \fBdeleteProperty\fP (\fBExecState\fP *exec, unsigned propertyName)"
.br
.ti -1c
.RI "\fBValue\fP \fBdefaultValue\fP (\fBExecState\fP *exec, Type hint) const "
.br
.ti -1c
.RI "bool \fBimplementsConstruct\fP () const "
.br
.ti -1c
.RI "\fBObject\fP \fBconstruct\fP (\fBExecState\fP *exec, const \fBList\fP &args)"
.br
.ti -1c
.RI "bool \fBimplementsCall\fP () const "
.br
.ti -1c
.RI "\fBValue\fP \fBcall\fP (\fBExecState\fP *exec, \fBObject\fP &thisObj, const \fBList\fP &args)"
.br
.ti -1c
.RI "bool \fBimplementsHasInstance\fP () const "
.br
.ti -1c
.RI "\fBBoolean\fP \fBhasInstance\fP (\fBExecState\fP *exec, const \fBValue\fP &value)"
.br
.ti -1c
.RI "const \fBScopeChain\fP & \fBscope\fP () const "
.br
.ti -1c
.RI "void \fBsetScope\fP (const \fBScopeChain\fP &s)"
.br
.ti -1c
.RI "\fBReferenceList\fP \fBpropList\fP (\fBExecState\fP *exec, bool recursive=true)"
.br
.ti -1c
.RI "\fBValue\fP \fBinternalValue\fP () const "
.br
.ti -1c
.RI "void \fBsetInternalValue\fP (const \fBValue\fP &v)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBObject\fP \fBdynamicCast\fP (const \fBValue\fP &v)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Represents an \fBObject\fP. 

This is a wrapper for ObjectImp 
.PP
Definition at line 81 of file object.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBObject\fP Object::dynamicCast (const \fBValue\fP & v)\fC [static]\fP"
.PP
Converts a \fBValue\fP into an \fBObject\fP. 
.PP
If the value's type is not ObjectType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type ObjectType, you should check the \fBisValid()\fP methods afterwards before calling any methods on the \fBObject\fP.
.PP
\fBReturns:\fP
.RS 4
The value converted to an object 
.RE
.PP

.PP
Definition at line 46 of file object.cpp.
.PP
Referenced by KJS::Error::create().
.SS "\fBValue\fP KJS::Object::prototype () const\fC [inline]\fP"
.PP
Returns the prototype of this object. 
.PP
Note that this is not the same as the 'prototype' property.
.PP
See ECMA 8.6.2
.PP
\fBReturns:\fP
.RS 4
The object's prototype 
.RE
.PP

.PP
Definition at line 656 of file object.h.
.SS "\fBUString\fP KJS::Object::className () const\fC [inline]\fP"
.PP
Returns the class name of the object. 
.PP
See ECMA 8.6.2
.PP
\fBReturns:\fP
.RS 4
The object's class name 
.RE
.PP

.PP
Definition at line 659 of file object.h.
.SS "\fBValue\fP KJS::Object::get (\fBExecState\fP * exec, const \fBIdentifier\fP & propertyName) const\fC [inline]\fP"
.PP
Retrieves the specified property from the object. 
.PP
If neither the object or any other object in it's prototype chain have the property, this function will return \fBUndefined\fP.
.PP
See ECMA 8.6.2.1
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIpropertyName\fP The name of the property to retrieve
.RE
.PP
\fBReturns:\fP
.RS 4
The specified property, or \fBUndefined\fP 
.RE
.PP

.PP
Definition at line 662 of file object.h.
.PP
Referenced by KJS::Reference::getValue().
.SS "void KJS::Object::put (\fBExecState\fP * exec, const \fBIdentifier\fP & propertyName, const \fBValue\fP & value, int attr = \fCNone\fP)\fC [inline]\fP"
.PP
Sets the specified property. 
.PP
See ECMA 8.6.2.2
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIpropertyName\fP The name of the property to set 
.br
\fIvalue\fP The value to set 
.RE
.PP

.PP
Definition at line 668 of file object.h.
.PP
Referenced by KJS::Error::create().
.SS "bool KJS::Object::canPut (\fBExecState\fP * exec, const \fBIdentifier\fP & propertyName) const\fC [inline]\fP"
.PP
Used to check whether or not a particular property is allowed to be set on an object. 
.PP
See ECMA 8.6.2.3
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIpropertyName\fP The name of the property 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the property can be set, otherwise false 
.RE
.PP

.PP
Definition at line 674 of file object.h.
.SS "bool KJS::Object::hasProperty (\fBExecState\fP * exec, const \fBIdentifier\fP & propertyName) const\fC [inline]\fP"
.PP
Checks to see whether the object (or any object in it's prototype chain) has a property with the specified name. 
.PP
See ECMA 8.6.2.4
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIpropertyName\fP The name of the property to check for 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the object has the property, otherwise false 
.RE
.PP

.PP
Definition at line 677 of file object.h.
.SS "bool KJS::Object::deleteProperty (\fBExecState\fP * exec, const \fBIdentifier\fP & propertyName)\fC [inline]\fP"
.PP
Removes the specified property from the object. 
.PP
See ECMA 8.6.2.5
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIpropertyName\fP The name of the property to delete 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the property was successfully deleted or did not exist on the object. false if deleting the specified property is not allowed. 
.RE
.PP

.PP
Definition at line 683 of file object.h.
.SS "\fBValue\fP KJS::Object::defaultValue (\fBExecState\fP * exec, Type hint) const\fC [inline]\fP"
.PP
Converts the object into a primitive value. 
.PP
The value return may differ depending on the supplied hint
.PP
See ECMA 8.6.2.6
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIhint\fP The desired primitive type to convert to 
.RE
.PP
\fBReturns:\fP
.RS 4
A primitive value converted from the objetc. Note that the type of primitive value returned may not be the same as the requested hint. 
.RE
.PP

.PP
Definition at line 689 of file object.h.
.SS "bool KJS::Object::implementsConstruct () const\fC [inline]\fP"
.PP
Whether or not the object implements the \fBconstruct()\fP method. 
.PP
If this returns false you should not call the \fBconstruct()\fP method on this object (typically, an assertion will fail to indicate this).
.PP
\fBReturns:\fP
.RS 4
true if this object implements the \fBconstruct()\fP method, otherwise false 
.RE
.PP

.PP
Definition at line 692 of file object.h.
.SS "\fBObject\fP KJS::Object::construct (\fBExecState\fP * exec, const \fBList\fP & args)\fC [inline]\fP"
.PP
Creates a new object based on this object. 
.PP
Typically this means the following: 1. A new object is created 2. The prototype of the new object is set to the value of this object's 'prototype' property 3. The \fBcall()\fP method of this object is called, with the new object passed as the this value 4. The new object is returned
.PP
In some cases, Host objects may differ from these semantics, although this is discouraged.
.PP
If an error occurs during construction, the execution state's exception will be set. This can be tested for with ExecState::hadException(). Under some circumstances, the exception object may also be returned.
.PP
Note: This function should not be called if \fBimplementsConstruct()\fP returns false, in which case it will result in an assertion failure.
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIargs\fP The arguments to be passed to \fBcall()\fP once the new object has been created 
.RE
.PP
\fBReturns:\fP
.RS 4
The newly created & initialized object 
.RE
.PP

.PP
Definition at line 695 of file object.h.
.PP
Referenced by KJS::Error::create().
.SS "bool KJS::Object::implementsCall () const\fC [inline]\fP"
.PP
Whether or not the object implements the \fBcall()\fP method. 
.PP
If this returns false you should not call the \fBcall()\fP method on this object (typically, an assertion will fail to indicate this).
.PP
\fBReturns:\fP
.RS 4
true if this object implements the \fBcall()\fP method, otherwise false 
.RE
.PP

.PP
Definition at line 698 of file object.h.
.SS "\fBValue\fP Object::call (\fBExecState\fP * exec, \fBObject\fP & thisObj, const \fBList\fP & args)"
.PP
Calls this object as if it is a function. 
.PP
Note: This function should not be called if \fBimplementsCall()\fP returns false, in which case it will result in an assertion failure.
.PP
See ECMA 8.6.2.3
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIthisObj\fP The obj to be used as 'this' within function execution. Note that in most cases this will be different from the C++ 'this' object. For example, if the ECMAScript code 'window.location.toString()' is executed, \fBcall()\fP will be invoked on the C++ object which implements the toString method, with the thisObj being window.location 
.br
\fIargs\fP \fBList\fP of arguments to be passed to the function 
.RE
.PP
\fBReturns:\fP
.RS 4
The return value from the function 
.RE
.PP

.PP
Definition at line 54 of file object.cpp.
.PP
References KJS::Error::create().
.SS "bool KJS::Object::implementsHasInstance () const\fC [inline]\fP"
.PP
Whether or not the object implements the \fBhasInstance()\fP method. 
.PP
If this returns false you should not call the \fBhasInstance()\fP method on this object (typically, an assertion will fail to indicate this).
.PP
\fBReturns:\fP
.RS 4
true if this object implements the \fBhasInstance()\fP method, otherwise false 
.RE
.PP

.PP
Definition at line 701 of file object.h.
.SS "\fBBoolean\fP KJS::Object::hasInstance (\fBExecState\fP * exec, const \fBValue\fP & value)\fC [inline]\fP"
.PP
Checks whether value delegates behavior to this object. 
.PP
Used by the instanceof operator.
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIvalue\fP The value to check 
.RE
.PP
\fBReturns:\fP
.RS 4
true if value delegates behavior to this object, otherwise false 
.RE
.PP

.PP
Definition at line 704 of file object.h.
.SS "const \fBScopeChain\fP & KJS::Object::scope () const\fC [inline]\fP"
.PP
Returns the scope of this object. 
.PP
This is used when execution declared functions - the execution context for the function is initialized with extra object in it's scope. An example of this is functions declared inside other functions:
.PP
.PP
.nf
 function f() {

   function b() {
     return prototype;
   }

   var x = 4;
   // do some stuff
 }
 f.prototype = new String();
.fi
.PP
.PP
When the function f.b is executed, its scope will include properties of f. So in the example above the return value of f.b() would be the new \fBString\fP object that was assigned to f.prototype.
.PP
\fBReturns:\fP
.RS 4
The function's scope 
.RE
.PP

.PP
Definition at line 707 of file object.h.
.SS "\fBReferenceList\fP KJS::Object::propList (\fBExecState\fP * exec, bool recursive = \fCtrue\fP)\fC [inline]\fP"
.PP
Returns a \fBList\fP of References to all the properties of the object. 
.PP
Used in 'for x in y' statements. The list is created new, so it can be freely modified without affecting the object's properties. It should be deleted by the caller.
.PP
Subclasses can override this method in ObjectImpl to provide the appearance of having extra properties other than those set specifically with \fBput()\fP.
.PP
\fBParameters:\fP
.RS 4
\fIexec\fP The current execution state 
.br
\fIrecursive\fP Whether or not properties in the object's prototype chain should be included in the list. 
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBList\fP of References to properties of the object. 
.RE
.PP

.PP
Definition at line 713 of file object.h.
.SS "\fBValue\fP KJS::Object::internalValue () const\fC [inline]\fP"
.PP
Returns the internal value of the object. 
.PP
This is used for objects such as \fBString\fP and \fBBoolean\fP which are wrappers for native types. The interal value is the actual value represented by the wrapper objects.
.PP
\fBSee also:\fP
.RS 4
ECMA 8.6.2 
.RE
.PP
\fBReturns:\fP
.RS 4
The internal value of the object 
.RE
.PP

.PP
Definition at line 716 of file object.h.
.SS "void KJS::Object::setInternalValue (const \fBValue\fP & v)\fC [inline]\fP"
.PP
Sets the internal value of the object. 
.PP
\fBSee also:\fP
.RS 4
\fBinternalValue()\fP
.RE
.PP
\fBParameters:\fP
.RS 4
\fIv\fP The new internal value 
.RE
.PP

.PP
Definition at line 719 of file object.h.

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