CrystalSpace

Public API Reference

Public Member Functions
iScript Struct Reference

This provides the interface to a scripting language interpreter. More...

#include <ivaria/script.h>

Inheritance diagram for iScript:
iBase scfImplementation1< csScriptCommon, iScript > csScriptCommon

List of all members.

Public Member Functions

virtual csPtr< iScriptValueCall (const char *name, const csRefArray< iScriptValue > &args=csRefArray< iScriptValue >())=0
 Calls a subroutine in the script.
virtual bool LoadModule (const char *name)=0
 Loads a named module in the script interpreter.
virtual bool LoadModule (const char *path, const char *filename)=0
 Loads a module in the script intepreter, from a file in VFS.
virtual bool LoadModuleNative (const char *path, const char *filename)=0
 Loads a module from a file in the native filesystem.
virtual csPtr< iScriptObjectNew (const char *type, const csRefArray< iScriptValue > &args=csRefArray< iScriptValue >())=0
 Creates an object in the script.
virtual bool Remove (const char *name)=0
 Removes a variable from the script interpreter.
virtual csPtr< iScriptValueRetrieve (const char *name)=0
 Gets the value of a variable in the script interpreter.
virtual bool RunText (const char *text)=0
 Runs some script in the scripting language.
virtual csPtr< iScriptValueRValue (int value)=0
 Creates a new script value container object and returns it.
virtual csPtr< iScriptValueRValue (float value)=0
 Creates a new script value container object and returns it.
virtual csPtr< iScriptValueRValue (double value)=0
 Creates a new script value container object and returns it.
virtual csPtr< iScriptValueRValue (const char *value)=0
 Creates a new script value container object and returns it.
virtual csPtr< iScriptValueRValue (bool value)=0
 Creates a new script value container object and returns it.
virtual csPtr< iScriptValueRValue (iScriptObject *value)=0
 Creates a new script value container object and returns it.
virtual bool Store (const char *name, iScriptValue *value)=0
 Sets a variable in the script interpreter.

Detailed Description

This provides the interface to a scripting language interpreter.

Remarks:
The details of any errors encountered in scripts are sent to the iReporter.

Definition at line 249 of file script.h.


Member Function Documentation

virtual csPtr<iScriptValue> iScript::Call ( const char *  name,
const csRefArray< iScriptValue > &  args = csRefArrayiScriptValue >() 
) [pure virtual]

Calls a subroutine in the script.

Parameters:
nameThe name of the subroutine.
argsAn optional array of arguments to pass to the subroutine.
Returns:
The return value of the subroutine. If the subroutine does not exist or encounters a runtime error then it returns 0. If it returns no value then it returns an iScriptValue with a bitmask of 0.
Remarks:
Scripting languages that support pass-by-reference may change the values of the arguments.

Implemented in csScriptCommon.

virtual bool iScript::LoadModule ( const char *  name) [pure virtual]

Loads a named module in the script interpreter.

Parameters:
nameLanguage-dependent name of the module.
Returns:
False if there is an error in the module or it cannot be loaded.
virtual bool iScript::LoadModule ( const char *  path,
const char *  filename 
) [pure virtual]

Loads a module in the script intepreter, from a file in VFS.

Parameters:
pathVirtual filesystem path to the script or module file.
filenameFilename of the script or module file.
Returns:
False if there is an error in the module or it cannot be loaded.
virtual bool iScript::LoadModuleNative ( const char *  path,
const char *  filename 
) [pure virtual]

Loads a module from a file in the native filesystem.

Parameters:
pathNative filesystem path to the script or module file.
filenameFilename of the script or module file.
Returns:
False if there is an error in the module or it cannot be loaded.
virtual csPtr<iScriptObject> iScript::New ( const char *  type,
const csRefArray< iScriptValue > &  args = csRefArrayiScriptValue >() 
) [pure virtual]

Creates an object in the script.

Parameters:
typeThe name of the class to instantiate.
argsAn optional array of arguments to pass to the constructor.
Returns:
0 if the constructor fails, or if the named class does not exist.
Remarks:
Scripting languages that support pass-by-reference may change the values of the arguments.
virtual bool iScript::Remove ( const char *  name) [pure virtual]

Removes a variable from the script interpreter.

Parameters:
nameThe name of the variable to remove.
Returns:
False if the variable does not exist or cannot be removed.
Remarks:
The name is given without any special characters (e.g. the dollar prefix in Perl).
virtual csPtr<iScriptValue> iScript::Retrieve ( const char *  name) [pure virtual]

Gets the value of a variable in the script interpreter.

Parameters:
nameThe name of the variable to retrieve.
Returns:
The value of the variable, or 0 if it does not exist.
Remarks:
The name is given without any special characters (e.g. the dollar prefix in Perl).

Implemented in csScriptCommon.

virtual bool iScript::RunText ( const char *  text) [pure virtual]

Runs some script in the scripting language.

Parameters:
textThe text of the script to execute.
Returns:
False if there was an error in the script.
virtual csPtr<iScriptValue> iScript::RValue ( int  value) [pure virtual]

Creates a new script value container object and returns it.

virtual csPtr<iScriptValue> iScript::RValue ( float  value) [pure virtual]

Creates a new script value container object and returns it.

virtual csPtr<iScriptValue> iScript::RValue ( double  value) [pure virtual]

Creates a new script value container object and returns it.

virtual csPtr<iScriptValue> iScript::RValue ( const char *  value) [pure virtual]

Creates a new script value container object and returns it.

virtual csPtr<iScriptValue> iScript::RValue ( bool  value) [pure virtual]

Creates a new script value container object and returns it.

virtual csPtr<iScriptValue> iScript::RValue ( iScriptObject value) [pure virtual]

Creates a new script value container object and returns it.

virtual bool iScript::Store ( const char *  name,
iScriptValue value 
) [pure virtual]

Sets a variable in the script interpreter.

Parameters:
nameThe name of the variable to set.
valueThe value to set the variable to.
Returns:
False if the variable could not be stored (e.g. illegal name, or variable already exists and is immutable).
Remarks:
The name is given without any special characters (e.g. the dollar prefix in Perl).

Implemented in csScriptCommon.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.0 by doxygen 1.7.6.1