jsdIValue

IID:b7964304-1dd1-11b2-ba20-cf4205772e9d
Inherits From:jsdIEphemeral

Constants

PRUint32 TYPE_BOOLEAN = 0
PRUint32 TYPE_DOUBLE = 1
PRUint32 TYPE_INT = 2
PRUint32 TYPE_FUNCTION = 3
PRUint32 TYPE_NULL = 4
PRUint32 TYPE_OBJECT = 5
PRUint32 TYPE_STRING = 6
PRUint32 TYPE_VOID = 7

Properties

readonly PRBool booleanValue

Value if interpreted as a boolean. Converts if necessary.

readonly double doubleValue

Value if interpreted as a double. Converts if necessary.

readonly PRInt32 intValue

Value if interpreted as an integer. Converts if necessary.

readonly PRBool isNative

False unless the value is a function declared in script.

readonly PRBool isNumber

True if the value represents a number, either double or integer. false for all other values, including numbers assigned as strings (eg. x = "1";)

readonly PRBool isPrimitive

True if the value represents a JavaScript primitive number or string

readonly char* jsClassName

Class name if this value represents an object. Empty string if the value is not an object.

readonly jsdIValue* jsConstructor

Constructor name if this value represents an object. Empty string if the value is not an object.

readonly JSDContext* JSDContext

readonly JSDValue* JSDValue

readonly char* jsFunctionName

Function name if this value represents a function. Empty string if the value is not a function.

readonly jsdIValue* jsParent

Parent value if this value represents an object, null if the value is not an object or the object has no parent.

readonly jsdIValue* jsPrototype

Prototype value if this value represents an object, null if the value is not an object or the object has no prototype.

readonly PRUint32 jsType

One of the TYPE_* values above.

readonly jsdIObject* objectValue

Value if interpreted as an object.

readonly PRInt32 propertyCount

Number of properties. 0 if the value is not an object, or the value is an object but has no properties.

readonly char* stringValue

Value if interpreted as a string. Converts if necessary.


Methods

void getProperties ( out arrayof jsdIProperty* propArray , out PRUint32 length ) jsdIProperty* getProperty ( char* name ) void getWrappedValue ( ) void refresh ( )

void getProperties ( out arrayof jsdIProperty* propArray , out PRUint32 length )

Retrieves all properties if this value represents an object. If this value is not an object a 0 element array is returned.

Arguments:
propArray: Array of jsdIProperty values for this value.
length: Size of array.

jsdIProperty* getProperty ( char* name )

Retrieves a single property from the value. Only valid if the value represents an object.

Arguments:
name: Name of the property to retrieve.

void getWrappedValue ( )

When called from JavaScript, this method returns the JavaScript value wrapped by this jsdIValue. The calling script is free to use the result as it would any other JavaScript value. When called from another language this method returns an xpconnect defined error code.


void refresh ( )

JsdIValues are wrappers around JavaScript engine structures. Much of the data is copied instead of shared. The refresh method is used to resync the jsdIValue with the underlying structure.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com