CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 
00025 struct iString;
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 
00065   virtual bool Call (const char *name, const char *format, ...)
00066     CS_GNUC_PRINTF(3, 4) = 0;
00067 
00074   virtual bool Call (const char *name, int &ret, const char *fmt, ...)
00075     CS_GNUC_PRINTF(4, 5) = 0;
00076 
00083   virtual bool Call (const char *name, float &ret, const char *fmt, ...)
00084     CS_GNUC_PRINTF(4, 5) = 0;
00085 
00092   virtual bool Call (const char *name, double &ret, const char *fmt, ...)
00093     CS_GNUC_PRINTF(4, 5) = 0;
00094 
00101   virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...)
00102     CS_GNUC_PRINTF(4, 5) = 0;
00103 
00110   virtual bool Call (const char *name, csRef<iScriptObject>&,
00111     const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0;
00112 
00117   virtual bool Set (const char *name, int data) = 0;
00118 
00123   virtual bool Set (const char *name, float data) = 0;
00124 
00129   virtual bool Set (const char *name, double data) = 0;
00130 
00135   virtual bool Set (const char *name, char const *data) = 0;
00136 
00141   virtual bool Set (const char *name, iScriptObject *data) = 0;
00142 
00147   virtual bool SetTruth (const char *name, bool isTrue) = 0;
00148 
00153   virtual bool Get (const char *name, int &data) const = 0;
00154 
00159   virtual bool Get (const char *name, float &data) const = 0;
00160 
00165   virtual bool Get (const char *name, double &data) const = 0;
00166 
00171   virtual bool Get (const char *name, csRef<iString>&) const = 0;
00172 
00177   virtual bool Get (const char *name, csRef<iScriptObject>&) const = 0;
00178 
00183   virtual bool GetTruth (const char *name, bool &isTrue) const = 0;
00184 };
00185 
00186 struct iObjectRegistry;
00187 
00188 SCF_VERSION (iScript, 0, 0, 2);
00189 
00199 struct iScript : public iBase
00200 {
00202   CS_DEPRECATED_METHOD virtual bool Initialize (iObjectRegistry *object_reg) = 0;
00203 
00205   CS_DEPRECATED_METHOD virtual bool Store (const char* name, void* data, 
00206     void* tag) = 0;
00207 
00209   virtual bool RunText (const char *text) = 0;
00210 
00212   virtual bool LoadModule (const char *name) = 0;
00213 
00220   virtual bool Call (const char *name, const char *format, ...)
00221     CS_GNUC_PRINTF(3, 4) = 0;
00222 
00229   virtual bool Call (const char *name, int &ret, const char *fmt, ...)
00230     CS_GNUC_PRINTF(4, 5) = 0;
00231 
00238   virtual bool Call (const char *name, float &ret, const char *fmt, ...)
00239     CS_GNUC_PRINTF(4, 5) = 0;
00240 
00247   virtual bool Call (const char *name, double &ret, const char *fmt, ...)
00248     CS_GNUC_PRINTF(4, 5) = 0;
00249 
00256   virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...)
00257     CS_GNUC_PRINTF(4, 5) = 0;
00258 
00265   virtual bool Call (const char *name, csRef<iScriptObject> &ret,
00266     const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0;
00267 
00274   virtual csRef<iScriptObject> NewObject (const char *type,
00275     const char *ctorFormat, ...) CS_GNUC_PRINTF(3, 4) = 0;
00276 
00278   virtual bool Store (const char *name, int data) = 0;
00279 
00281   virtual bool Store (const char *name, float data) = 0;
00282 
00284   virtual bool Store (const char *name, double data) = 0;
00285 
00287   virtual bool Store (const char *name, char const *data) = 0;
00288 
00290   virtual bool Store (const char *name, iScriptObject *data) = 0;
00291 
00293   virtual bool SetTruth (const char *name, bool isTrue) = 0;
00294 
00299   virtual bool Retrieve (const char *name, int &data) const = 0;
00300 
00305   virtual bool Retrieve (const char *name, float &data) const = 0;
00306 
00311   virtual bool Retrieve (const char *name, double &data) const = 0;
00312 
00317   virtual bool Retrieve (const char *name, csRef<iString>&) const = 0;
00318 
00323   virtual bool Retrieve (const char *name, csRef<iScriptObject>&) const = 0;
00324 
00329   virtual bool GetTruth (const char *name, bool &isTrue) const = 0;
00330 
00335   virtual bool Remove (const char *name) = 0;
00336 };
00337 
00338 #endif // __CS_IVARIA_SCRIPT_H__

Generated for Crystal Space by doxygen 1.4.4