[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

4.18.1 The iScript Interface

The ‘iScript’ interface is used from C++ code to interact with scripting language interpreters. It enables one to create and destroy variables and set and get their values, call subroutines, and create new objects in the scripting language.

The ‘iScriptObject’ interface represents an object in the scripting language, and enables one to call its methods and set and get its properties. It can also provide the name of the object's class (returned as a string), test for membership of a certain class (the "is-a" relationship, returning true if the object in question is an instance of the specified class or one of its subclasses), and if the object is a scripting language wrapper around a C++ object (i.e. it is part of the Crystal Space bindings) then it can provide a pointer to the underlying C++ object.

The ‘iScriptValue’ interface represents a constant expression as used by the scripting language, such as 3.14159 or "hello". Pointers to implementations of this interface are used with variable accessors and subroutine calls in ‘iScript’ and with property accessors and method calls in ‘iScriptObject’. New instances are returned by ‘iScript::RValue()’. The storable types are ‘int’, ‘float’, ‘double’, ‘bool’, ‘const char*’ (string) and ‘iScriptObject*’.

These interfaces are defined in ‘include/ivaria/script.h’, and fully documented in the Public API Reference.

This document was generated using texi2html 1.76.