Unicorn XML Toolkit
Version 1.00.00

Namespace EcmaScript
Class CContext

class CContext {
public:
    CContext();
    ~CContext();
public:
    CScopeChain *GetScopeChain();
    CGlobalObject *GetGlobalObject();
    XObject GetActivationObject();
    XObject GetVariableObject();
    XObject GetThis();
public:
    XObject GetBase(const XValue &pReference);
    CPropertyName GetPropertyName(const XValue &pReference);
    XValue GetValue(const XValue &pReference);
    void PutValue(const XValue &pReference, const XValue &pValue);
public:
    XValue ToPrimitive(const XValue &pValue, int nPreferredType);
    bool ToBoolean(const XValue &pValue);
    CNumber ToNumber(const XValue &pValue);
    CNumber ToInteger(const XValue &pValue);
    CNumber ToInt32(const XValue &pValue);
    CNumber ToUint32(const XValue &pValue);
    CNumber ToUint16(const XValue &pValue);
    CString ToString(const XValue &pValue);
    XObject ToObject(const XValue &pValue);
public:
    XValue EvaluateIdentifier(const CPropertyName &identifier);
    };

The ECMAScript execution context.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CNumber, CPropertyName, CValue, CObject, CScopeChain, CGlobalObject
Constructor/Destructor Summary
CContext ();
����������Constructs the context.
~CContext ();
����������Destroys the context.

Function Summary
CScopeChain�* GetScopeChain ();
����������Returns a scope chain associated with this context.
CGlobalObject�* GetGlobalObject ();
����������Returns a global object associated with this context.
XObject GetActivationObject ();
����������Returns an activation object associated with this context.
XObject GetVariableObject ();
����������Returns a variable object associated with this context.
XObject GetThis ();
����������Returns this object associated with this context.
XObject GetBase (const XValue &pReference);
����������Returns a base object of the given reference.
CPropertyName GetPropertyName (const XValue &pReference);
����������Returns a property name of the given reference.
XValue GetValue (const XValue &pReference);
����������Returns a value of the property indicated by the given reference.
void PutValue (const XValue &pReference, const XValue &pValue);
����������Puts the value of the property indicated by the given reference.
XValue ToPrimitive (const XValue &pValue, int nPreferredType);
����������Converts the given value to a primitive type.
bool ToBoolean (const XValue &pValue);
����������Converts the given value to a boolean.
CNumber ToNumber (const XValue &pValue);
����������Converts the given value to a number.
CNumber ToInteger (const XValue &pValue);
����������Converts the given value to an integer.
CNumber ToInt32 (const XValue &pValue);
����������Converts the given value to a 32-bit integer.
CNumber ToUint32 (const XValue &pValue);
����������Converts the given value to an unsigned 32-bit integer.
CNumber ToUint16 (const XValue &pValue);
����������Converts the given value to an unsigned 16-bit integer.
CString ToString (const XValue &pValue);
����������Converts the given value to a string.
XObject ToObject (const XValue &pValue);
����������Converts the given value to an object.
XValue EvaluateIdentifier (const CPropertyName &identifier);
����������Evaluates the ECMAScript identifier (that is, maps the identifier to a reference).

Constructor/Destructor Detail

CContext

CContext();

Constructs the context.

~CContext

~CContext();

Destroys the context.

Function Detail

GetScopeChain

CScopeChain *GetScopeChain();

Returns a scope chain associated with this context.

Returns:
the scope chain associated with this context

GetGlobalObject

CGlobalObject *GetGlobalObject();

Returns a global object associated with this context.

Returns:
the global object associated with this context

GetActivationObject

XObject GetActivationObject();

Returns an activation object associated with this context.

Returns:
the activation object associated with this context

GetVariableObject

XObject GetVariableObject();

Returns a variable object associated with this context.

Returns:
the variable object associated with this context

GetThis

XObject GetThis();

Returns this object associated with this context.

Returns:
this object associated with this context

GetBase

XObject GetBase(const XValue &pReference);

Returns a base object of the given reference.

This function corresponds to the ECMAScript GetBase operation.

Parameters:
pReference - the reference value
Returns:
the base object of the given reference

GetPropertyName

CPropertyName GetPropertyName(const XValue &pReference);

Returns a property name of the given reference.

This function corresponds to the ECMAScript GetPropertyName operation.

Parameters:
pReference - the reference value
Returns:
the property name of the given reference

GetValue

XValue GetValue(const XValue &pReference);

Returns a value of the property indicated by the given reference.

This function corresponds to the ECMAScript GetValue operation.

Parameters:
pReference - the reference value
Returns:
the value of the property indicated by the given reference

PutValue

void PutValue(const XValue &pReference, const XValue &pValue);

Puts the value of the property indicated by the given reference.

This function corresponds to the ECMAScript PutValue operation.

Parameters:
pReference - the reference value
pValue - the value to put

ToPrimitive

XValue ToPrimitive(const XValue &pValue, int nPreferredType);

Converts the given value to a primitive type.

This function corresponds to the ECMAScript ToPrimitive operator.

Parameters:
pValue - the value to convert
nPreferredType - the preferred type of the result
Returns:
the result of conversion

ToBoolean

bool ToBoolean(const XValue &pValue);

Converts the given value to a boolean.

This function corresponds to the ECMAScript ToBoolean operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

ToNumber

CNumber ToNumber(const XValue &pValue);

Converts the given value to a number.

This function corresponds to the ECMAScript ToNumber operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

ToInteger

CNumber ToInteger(const XValue &pValue);

Converts the given value to an integer.

This function corresponds to the ECMAScript ToInteger operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

ToInt32

CNumber ToInt32(const XValue &pValue);

Converts the given value to a 32-bit integer.

This function corresponds to the ECMAScript ToInt32 operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

ToUint32

CNumber ToUint32(const XValue &pValue);

Converts the given value to an unsigned 32-bit integer.

This function corresponds to the ECMAScript ToUint32 operator.

Parameters:
pValue - the value to convert
Returns:
the number containing the result of conversion

ToUint16

CNumber ToUint16(const XValue &pValue);

Converts the given value to an unsigned 16-bit integer.

This function corresponds to the ECMAScript ToUint16 operator.

Parameters:
pValue - the value to convert
Returns:
the number containing the result of conversion

ToString

CString ToString(const XValue &pValue);

Converts the given value to a string.

This function corresponds to the ECMAScript ToString operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

ToObject

XObject ToObject(const XValue &pValue);

Converts the given value to an object.

This function corresponds to the ECMAScript ToObject operator.

Parameters:
pValue - the value to convert
Returns:
the result of conversion

EvaluateIdentifier

XValue EvaluateIdentifier(const CPropertyName &identifier);

Evaluates the ECMAScript identifier (that is, maps the identifier to a reference).

Parameters:
identifier - the property name representing the identifier
Returns:
the reference value obtained as the result of evaluation

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.