class KJScript

ECMAScript interpreter. More...

Definition#include <kjs.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

 KJScript ()

Create a new ECMAScript interpreter. You can later ask it to interprete code by passing it via evaluate.

KJScript ()

Destructor

bool  evaluate (const char *code)

Asks the interpreter to evaluate a piece of code. If called more than once the state (global variables, functions etc.) will be preserved between each call.

Parameters:
codeis a string containing the code to be executed.

bool  evaluate (const QChar *code, unsigned int length)

Same as above. Only differing in the arguments accepted.

Parameters:
codeis a pointer to an Unicode string containing the code to be executed.
lengthnumber of characters.

bool  evaluate (const KJS::UString &code)

Added for convenience in case you have the code in available in internal representation already.

Parameters:
codeis an Unicode string containing the code to be executed.

void  clear ()

Clear the interpreter's memory. Otherwise, function declarations and global variables will be remembered after each invokation of KJScript::evaluate.

void  enableDebug ()

Adds a debug() function to the set of pre-defined properties. debug(arg) tries to convert 'arg' to a string and prints the result to stderr. If you want to debug self defined Host Objects this way you should provide them with a toString() method that returns a string.


Generated by: root@porky.devel.redhat.com on Wed May 10 08:57:04 2000, using kdoc 2.0a35.