CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ivaria/script.h

00001 /*
00002     Copyright (C) 1999 by Brandon Ehle <azverkan@yahoo.com>
00003               (C) 2003 by Mat Sutcliffe <oktal@gmx.co.uk>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_IVARIA_SCRIPT_H__
00021 #define __CS_IVARIA_SCRIPT_H__
00022 
00023 #include "csutil/scf.h"
00024 #include "csutil/ref.h"
00025 #include "iutil/string.h"
00026 
00027 SCF_VERSION (iScriptObject, 0, 0, 1);
00028 
00039 struct iScriptObject : public iBase
00040 {
00045   virtual bool IsType (const char *) const = 0;
00046 
00051   virtual iBase* GetPointer () const = 0;
00052 
00057   virtual bool SetPointer (iBase *) = 0;
00058 
00064   virtual bool Call (const char *name, const char *format, ...)
00065     CS_GNUC_PRINTF(3, 4) = 0;
00066 
00072   virtual bool Call (const char *name, int &ret, const char *fmt, ...)
00073     CS_GNUC_PRINTF(4, 5) = 0;
00074 
00080   virtual bool Call (const char *name, float &ret, const char *fmt, ...)
00081     CS_GNUC_PRINTF(4, 5) = 0;
00082 
00088   virtual bool Call (const char *name, double &ret, const char *fmt, ...)
00089     CS_GNUC_PRINTF(4, 5) = 0;
00090 
00096   virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...)
00097     CS_GNUC_PRINTF(4, 5) = 0;
00098 
00104   virtual bool Call (const char *name, csRef<iScriptObject>&,
00105     const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0;
00106 
00111   virtual bool Set (const char *name, int data) = 0;
00112 
00117   virtual bool Set (const char *name, float data) = 0;
00118 
00123   virtual bool Set (const char *name, double data) = 0;
00124 
00129   virtual bool Set (const char *name, char const *data) = 0;
00130 
00135   virtual bool Set (const char *name, iScriptObject *data) = 0;
00136 
00141   virtual bool SetTruth (const char *name, bool isTrue) = 0;
00142 
00147   virtual bool Get (const char *name, int &data) const = 0;
00148 
00153   virtual bool Get (const char *name, float &data) const = 0;
00154 
00159   virtual bool Get (const char *name, double &data) const = 0;
00160 
00165   virtual bool Get (const char *name, csRef<iString>&) const = 0;
00166 
00171   virtual bool Get (const char *name, csRef<iScriptObject>&) const = 0;
00172 
00177   virtual bool GetTruth (const char *name, bool &isTrue) const = 0;
00178 };
00179 
00180 struct iObjectRegistry;
00181 
00182 SCF_VERSION (iScript, 0, 0, 2);
00183 
00193 struct iScript : public iBase
00194 {
00196   virtual bool Initialize (iObjectRegistry *object_reg) = 0;
00197 
00199   virtual bool Store (const char* name, void* data, void* tag) = 0;
00200 
00202   virtual bool RunText (const char *text) = 0;
00203 
00205   virtual bool LoadModule (const char *name) = 0;
00206 
00212   virtual bool Call (const char *name, const char *format, ...)
00213     CS_GNUC_PRINTF(3, 4) = 0;
00214 
00220   virtual bool Call (const char *name, int &ret, const char *fmt, ...)
00221     CS_GNUC_PRINTF(4, 5) = 0;
00222 
00228   virtual bool Call (const char *name, float &ret, const char *fmt, ...)
00229     CS_GNUC_PRINTF(4, 5) = 0;
00230 
00236   virtual bool Call (const char *name, double &ret, const char *fmt, ...)
00237     CS_GNUC_PRINTF(4, 5) = 0;
00238 
00244   virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...)
00245     CS_GNUC_PRINTF(4, 5) = 0;
00246 
00252   virtual bool Call (const char *name, csRef<iScriptObject> &ret,
00253     const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0;
00254 
00260   virtual csRef<iScriptObject> NewObject (const char *type,
00261     const char *ctorFormat, ...) CS_GNUC_PRINTF(3, 4) = 0;
00262 
00264   virtual bool Store (const char *name, int data) = 0;
00265 
00267   virtual bool Store (const char *name, float data) = 0;
00268 
00270   virtual bool Store (const char *name, double data) = 0;
00271 
00273   virtual bool Store (const char *name, char const *data) = 0;
00274 
00276   virtual bool Store (const char *name, iScriptObject *data) = 0;
00277 
00279   virtual bool SetTruth (const char *name, bool isTrue) = 0;
00280 
00285   virtual bool Retrieve (const char *name, int &data) const = 0;
00286 
00291   virtual bool Retrieve (const char *name, float &data) const = 0;
00292 
00297   virtual bool Retrieve (const char *name, double &data) const = 0;
00298 
00303   virtual bool Retrieve (const char *name, csRef<iString>&) const = 0;
00304 
00309   virtual bool Retrieve (const char *name, csRef<iScriptObject>&) const = 0;
00310 
00315   virtual bool GetTruth (const char *name, bool &isTrue) const = 0;
00316 
00321   virtual bool Remove (const char *name) = 0;
00322 };
00323 
00324 #endif // __CS_IVARIA_SCRIPT_H__

Generated for Crystal Space by doxygen 1.2.18