sqrat  0.9
sqrat
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
Sqrat::Script Class Reference

Helper class for managing Squirrel scripts. More...

#include <sqratScript.h>

Inheritance diagram for Sqrat::Script:
Sqrat::Object

Public Member Functions

 Script (HSQUIRRELVM v=DefaultVM::Get())
 
void CompileString (const string &script, const string &name=_SC(""))
 
bool CompileString (const string &script, string &errMsg, const string &name=_SC(""))
 
void CompileFile (const string &path)
 
bool CompileFile (const string &path, string &errMsg)
 
void Run ()
 
bool Run (string &errMsg)
 
void WriteCompiledFile (const string &path)
 
- Public Member Functions inherited from Sqrat::Object
 Object ()
 
 Object (const Object &so)
 
 Object (HSQOBJECT o, HSQUIRRELVM v=DefaultVM::Get())
 
template<class T >
 Object (T *instance, HSQUIRRELVM v=DefaultVM::Get())
 
virtual ~Object ()
 
Objectoperator= (const Object &so)
 
HSQUIRRELVM & GetVM ()
 
HSQUIRRELVM GetVM () const
 
SQObjectType GetType () const
 
bool IsNull () const
 
virtual HSQOBJECT GetObject () const
 
virtual HSQOBJECT & GetObject ()
 
 operator HSQOBJECT & ()
 
void Release ()
 
Object GetSlot (const SQChar *slot) const
 
Object GetSlot (SQInteger index) const
 
template<class T >
Cast () const
 
template<class T >
Object operator[] (T slot)
 
SQInteger GetSize () const
 
bool Next (iterator &iter) const
 

Detailed Description

Helper class for managing Squirrel scripts.

Constructor & Destructor Documentation

Sqrat::Script::Script ( HSQUIRRELVM  v = DefaultVM::Get())
inline

Default constructor

Parameters
vVM that the Script will be associated with

Member Function Documentation

void Sqrat::Script::CompileFile ( const string &  path)
inline

Sets up the Script using a file containing a Squirrel script

Parameters
pathFile path containing a Squirrel script
Remarks
This function MUST have its Error handled if it occurred.
bool Sqrat::Script::CompileFile ( const string &  path,
string &  errMsg 
)
inline

Sets up the Script using a file containing a Squirrel script

Parameters
pathFile path containing a Squirrel script
errMsgString that is filled with any errors that may occur
void Sqrat::Script::CompileString ( const string &  script,
const string &  name = _SC("") 
)
inline

Sets up the Script using a string containing a Squirrel script

Parameters
scriptString containing a Squirrel script
Remarks
This function MUST have its Error handled if it occurred.

sizeof(SQChar)

bool Sqrat::Script::CompileString ( const string &  script,
string &  errMsg,
const string &  name = _SC("") 
)
inline

Sets up the Script using a string containing a Squirrel script

Parameters
scriptString containing a Squirrel script
errMsgString that is filled with any errors that may occur

sizeof(SQChar)

void Sqrat::Script::Run ( )
inline

Runs the script

Remarks
This function MUST have its Error handled if it occurred.
bool Sqrat::Script::Run ( string &  errMsg)
inline

Runs the script

Parameters
errMsgString that is filled with any errors that may occur
void Sqrat::Script::WriteCompiledFile ( const string &  path)
inline

Writes the byte code of the Script to a file

Parameters
pathFile path to write to

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