|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CObject: public CInterface { public: enum { hintNone, hintString, hintNumber }; public: CObject(); virtual ~CObject(); public: virtual XObject Prototype() = 0; virtual CString Class() = 0; virtual XValue Value() = 0; virtual void SetValue(const XValue &pValue) = 0; virtual XValue Get( CContext &context, const CPropertyName &propertyName) = 0; virtual void Put( CContext &context, const CPropertyName &propertyName, const XValue &pValue) = 0; virtual bool CanPut( CContext &context, const CPropertyName &propertyName) = 0; virtual bool HasProperty( CContext &context, const CPropertyName &propertyName) = 0; virtual bool Delete( CContext &context, const CPropertyName &propertyName) = 0; virtual XValue DefaultValue(CContext &context, int nHint) = 0; virtual XValue Construct( CContext &context, const CList &argList) = 0; virtual XValue Call( CContext &context, const XObject &pThis, const CList &argList) = 0; virtual bool Match( CContext &context, CString &strString, int nIndex, RegExp::CResult &result) = 0; virtual void CreateProperty( const CPropertyName &propertyName, const XValue &pValue, int nAttributes, bool bOverride=true) = 0; virtual XEnumerator CreateEnumerator() = 0; virtual CString TypeOf() = 0; virtual XObject CreateObject() = 0; virtual bool Equals(const XObject &pObject); };
The abstract interface to ECMAScript objects.
CValue, CPropertyName, CContext, CEnumerator, CList, RegExp::CResult
Constructor/Destructor Summary | |
CObject
();
����������Constructs the object. |
|
~CObject
();
����������Destroys the 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. |
bool
|
Equals
(const XObject &pObject);
����������Matches this object and another object for equality. |
Constructor/Destructor Detail |
CObject();
Constructs the object.
virtual ~CObject();
Destroys the object.
Function Detail |
virtual XObject Prototype() = 0;
Returns the prototype object of this object.
This function corresponds to the internal
[[Prototype]]
property.
NULL
if this object has no prototypevirtual CString Class() = 0;
Returns the class of this object.
This function corresponds to the internal
[[Class]]
property.
virtual XValue Value() = 0;
Returns the value associated with this object.
This function corresponds to the internal
[[Value]]
property.
NULL
if this object has no value associatedvirtual void SetValue(const XValue &pValue) = 0;
Associates the new value with this object.
This function corresponds to the internal
[[Value]]
property.
pValue
- the new valuevirtual XValue Get( CContext &context, const CPropertyName &propertyName) = 0;
Gets the value of the given property of this object.
This function corresponds to the internal
[[Get]]
property.
context
- the evaluation contextpropertyName
- the property namevirtual void Put( CContext &context, const CPropertyName &propertyName, const XValue &pValue) = 0;
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 putvirtual bool CanPut( CContext &context, const CPropertyName &propertyName) = 0;
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
otherwisevirtual bool HasProperty( CContext &context, const CPropertyName &propertyName) = 0;
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
otherwisevirtual bool Delete( CContext &context, const CPropertyName &propertyName) = 0;
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
otherwisevirtual XValue DefaultValue(CContext &context, int nHint) = 0;
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 valuevirtual XValue Construct( CContext &context, const CList &argList) = 0;
Calls this object as a constructor.
This function corresponds to the internal
[[Construct]]
property.
context
- the evaluation contextargList
- the list of argument valuesvirtual XValue Call( CContext &context, const XObject &pThis, const CList &argList) = 0;
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 valuesvirtual bool Match( CContext &context, CString &strString, int nIndex, RegExp::CResult &result) = 0;
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
otherwisevirtual void CreateProperty( const CPropertyName &propertyName, const XValue &pValue, int nAttributes, bool bOverride=true) = 0;
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 overridenvirtual XEnumerator CreateEnumerator() = 0;
Creates an enumerator for properties of this object.
virtual CString TypeOf() = 0;
Returns a string representing type of this object.
virtual XObject CreateObject() = 0;
Called by the ECMAScript Object constructor when this object is passed as a constructor argument.
virtual bool Equals(const XObject &pObject);
Matches this object and another object for equality.
This function is needed,
because certain classes of host objects might be represented
by several instances of
CObject
class;
therefore the straightforward matching of instance pointers for equality
may be not sufficient to determine whether these pointers
refer to the same ECMAScript object.
pObject
- the object to matchtrue
, if this object and
the object specified refer to the same ECMAScript object
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |