|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CNativeObject: virtual public CObject { friend class CNativeEnumerator; public: CNativeObject( CGlobalObject *pGlobalObject, const XObject &pPrototype); ~CNativeObject(); public: XObject Prototype(); CString Class(); XValue Value(); void SetValue(const XValue &pValue); XValue Get( CContext &context, const CPropertyName &propertyName); void Put( CContext &context, const CPropertyName &propertyName, const XValue &pValue); bool CanPut( CContext &context, const CPropertyName &propertyName); bool HasProperty( CContext &context, const CPropertyName &propertyName); bool Delete( CContext &context, const CPropertyName &propertyName); XValue DefaultValue(CContext &context, int nHint); XValue Construct(CContext &context, const CList &argList); XValue Call( CContext &context, const XObject &pThis, const CList &argList); bool Match( CContext &context, CString &strString, int nIndex, RegExp::CResult &result); void CreateProperty( const CPropertyName &propertyName, const XValue &pValue, int nAttributes, bool bOverride=true); XEnumerator CreateEnumerator(); CString TypeOf(); XObject CreateObject(); public: void SetPropertyMap(const XPropertyMap &pPropertyMap); public: virtual XValue GetProperty( CContext &context, int nSelector); virtual void PutProperty( CContext &context, int nSelector, const XValue &pValue); virtual XValue FunctionCall( CContext &context, int nSelector, const XObject &pThis, const CList &argList); };
The abstract interface to ECMAScript native objects.
CValue, CPropertyName, CContext, CEnumerator, CList, CPropertyMap, RegExp::CResult
Constructor/Destructor Summary | |
CNativeObject
(CGlobalObject *pGlobalObject, const XObject &pPrototype);
����������Constructs the native object. |
|
~CNativeObject
();
����������Destroys the native object. |
Function Summary | |
XObject
|
Prototype
();
����������Returns the prototype object of this object. |
CString
|
Class
();
����������Returns the class of this object. |
XValue
|
Value
();
����������Returns the value associated with this object. |
void
|
SetValue
(const XValue &pValue);
����������Associates the new value with this object. |
XValue
|
Get
(CContext &context, const CPropertyName &propertyName);
����������Gets the value of the given property of this object. |
void
|
Put
(CContext &context, const CPropertyName &propertyName, const XValue &pValue);
����������Puts the given value of the given property of this object. |
bool
|
CanPut
(CContext &context, const CPropertyName &propertyName);
����������Tests whether the put operation is allowed for the given property of this object. |
bool
|
HasProperty
(CContext &context, const CPropertyName &propertyName);
����������Tests whether this object has the given property. |
bool
|
Delete
(CContext &context, const CPropertyName &propertyName);
����������Deletes the given property from the property list of this object. |
XValue
|
DefaultValue
(CContext &context, int nHint);
����������Returns the defaut value associated with this object. |
XValue
|
Construct
(CContext &context, const CList &argList);
����������Calls this object as a constructor. |
XValue
|
Call
(CContext &context, const XObject &pThis, const CList &argList);
����������Calls this object as a function. |
bool
|
Match
(CContext &context, CString &strString, int nIndex, RegExp::CResult &result);
����������Matches the given string against this object. |
void
|
CreateProperty
(const CPropertyName &propertyName, const XValue &pValue, int nAttributes, bool bOverride=true);
����������Creates a property with the given property name, initial value and attributes. |
XEnumerator
|
CreateEnumerator
();
����������Creates an enumerator for properties of this object. |
CString
|
TypeOf
();
����������Returns a string representing type of this object. |
XObject
|
CreateObject
();
����������Called by the ECMAScript Object constructor when this object is passed as a constructor argument. |
void
|
SetPropertyMap
(const XPropertyMap &pPropertyMap);
����������Attaches a property map to this native object. |
XValue
|
GetProperty
(CContext &context, int nSelector);
����������Gets the value of the property referenced by the given selector. |
void
|
PutProperty
(CContext &context, int nSelector, const XValue &pValue);
����������Puts the value of the property referenced by the given selector. |
XValue
|
FunctionCall
(CContext &context, int nSelector, const XObject &pThis, const CList &argList);
����������Calls the function property referenced by the given selector. |
Constructor/Destructor Detail |
CNativeObject( CGlobalObject *pGlobalObject, const XObject &pPrototype);
Constructs the native object.
pGlobalObject
- the global objectpPrototype
- the prototype
of the constructed object~CNativeObject();
Destroys the native object.
Function Detail |
XObject Prototype();
Returns the prototype object of this object.
This function corresponds to the internal
[[Prototype]]
property.
NULL
if this object has no prototypeCString Class();
Returns the class of this object.
This function corresponds to the internal
[[Class]]
property.
XValue Value();
Returns the value associated with this object.
This function corresponds to the internal
[[Value]]
property.
NULL
if this object has no value associatedvoid SetValue(const XValue &pValue);
Associates the new value with this object.
This function corresponds to the internal
[[Value]]
property.
pValue
- the new valueXValue Get( CContext &context, const CPropertyName &propertyName);
Gets the value of the given property of this object.
This function corresponds to the internal
[[Get]]
property.
context
- the evaluation contextpropertyName
- the property namevoid Put( CContext &context, const CPropertyName &propertyName, const XValue &pValue);
Puts the given value of the given property of this object.
This function corresponds to the internal
[[Put]]
property.
context
- the evaluation contextpropertyName
- the property namepValue
- the value to putbool CanPut( CContext &context, const CPropertyName &propertyName);
Tests whether the put operation is allowed for the given property of this object.
This function corresponds to the internal
[[CanPut]]
property.
context
- the evaluation contextpropertyName
- the property nametrue
if the put operation is allowed;
false
otherwisebool HasProperty( CContext &context, const CPropertyName &propertyName);
Tests whether this object has the given property.
This function corresponds to the internal
[[HasProperty]]
property.
context
- the evaluation contextpropertyName
- the property nametrue
if this object has
the property;
false
otherwisebool Delete( CContext &context, const CPropertyName &propertyName);
Deletes the given property from the property list of this object.
This function corresponds to the internal
[[Delete]]
property.
context
- the evaluation contextpropertyName
- the property nametrue
if the property
was deleted successfully;
false
otherwiseXValue DefaultValue(CContext &context, int nHint);
Returns the defaut value associated with this object.
The desired type of the default value must be specified
using
nHint
parameter. Allowed values for this parameter
are
CValue::hintNone
,
CValue::hintString
,
and
CValue::hintNumber
.
This function corresponds to the internal
[[DefaultValue]]
property.
context
- the evaluation contextnHint
- the integer specifying the desired type
of the default valueXValue Construct(CContext &context, const CList &argList);
Calls this object as a constructor.
This function corresponds to the internal
[[Construct]]
property.
context
- the evaluation contextargList
- the list of argument valuesXValue Call( CContext &context, const XObject &pThis, const CList &argList);
Calls this object as a function.
This function corresponds to the internal
[[Call]]
property.
context
- the evaluation contextpThis
- the object to be used as value of
this
during the function callargList
- the list of argument valuesbool Match( CContext &context, CString &strString, int nIndex, RegExp::CResult &result);
Matches the given string against this object.
This function corresponds to the internal
[[Match]]
property (defined in the 3rd edition
of ECMA-262).
context
- the evaluation contextstrString
- the string to matchnIndex
- the starting index in the stringresult
- on return, contains the result of matchtrue
if match succeeded;
false
otherwisevoid CreateProperty( const CPropertyName &propertyName, const XValue &pValue, int nAttributes, bool bOverride=true);
Creates a property with the given property name, initial value and attributes.
propertyName
- the property namepValue
- the initial value of the propertynAttributes
- the set of property attributes represented as
the combination of bit flags declared by the
CAttribute
classbOverride
- indicates whether property with the given property
name, if already present, must be overridenXEnumerator CreateEnumerator();
Creates an enumerator for properties of this object.
CString TypeOf();
Returns a string representing type of this object.
XObject CreateObject();
Called by the ECMAScript Object constructor when this object is passed as a constructor argument.
void SetPropertyMap(const XPropertyMap &pPropertyMap);
Attaches a property map to this native object.
pPropertyMap
- the property mapvirtual XValue GetProperty( CContext &context, int nSelector);
Gets the value of the property referenced by the given selector.
context
- the execution contextnSelector
- the selectorvirtual void PutProperty( CContext &context, int nSelector, const XValue &pValue);
Puts the value of the property referenced by the given selector.
context
- the execution contextnSelector
- the selectorpValue
- the value to putvirtual XValue FunctionCall( CContext &context, int nSelector, const XObject &pThis, const CList &argList);
Calls the function property referenced by the given selector.
See the description of the
CBuiltinFunction
class for the definition of function selectors.
context
- the execution contextnSelector
- the selectorpThis
-
this
objectargList
- the list of argument values
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |