CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | 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 #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   CS_DEPRECATED_METHOD virtual bool Initialize (iObjectRegistry *object_reg) = 0;
00197 
00199   CS_DEPRECATED_METHOD virtual bool Store (const char* name, void* data, 
00200     void* tag) = 0;
00201 
00203   virtual bool RunText (const char *text) = 0;
00204 
00206   virtual bool LoadModule (const char *name) = 0;
00207 
00213   virtual bool Call (const char *name, const char *format, ...)
00214     CS_GNUC_PRINTF(3, 4) = 0;
00215 
00221   virtual bool Call (const char *name, int &ret, const char *fmt, ...)
00222     CS_GNUC_PRINTF(4, 5) = 0;
00223 
00229   virtual bool Call (const char *name, float &ret, const char *fmt, ...)
00230     CS_GNUC_PRINTF(4, 5) = 0;
00231 
00237   virtual bool Call (const char *name, double &ret, const char *fmt, ...)
00238     CS_GNUC_PRINTF(4, 5) = 0;
00239 
00245   virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...)
00246     CS_GNUC_PRINTF(4, 5) = 0;
00247 
00253   virtual bool Call (const char *name, csRef<iScriptObject> &ret,
00254     const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0;
00255 
00261   virtual csRef<iScriptObject> NewObject (const char *type,
00262     const char *ctorFormat, ...) CS_GNUC_PRINTF(3, 4) = 0;
00263 
00265   virtual bool Store (const char *name, int data) = 0;
00266 
00268   virtual bool Store (const char *name, float data) = 0;
00269 
00271   virtual bool Store (const char *name, double data) = 0;
00272 
00274   virtual bool Store (const char *name, char const *data) = 0;
00275 
00277   virtual bool Store (const char *name, iScriptObject *data) = 0;
00278 
00280   virtual bool SetTruth (const char *name, bool isTrue) = 0;
00281 
00286   virtual bool Retrieve (const char *name, int &data) const = 0;
00287 
00292   virtual bool Retrieve (const char *name, float &data) const = 0;
00293 
00298   virtual bool Retrieve (const char *name, double &data) const = 0;
00299 
00304   virtual bool Retrieve (const char *name, csRef<iString>&) const = 0;
00305 
00310   virtual bool Retrieve (const char *name, csRef<iScriptObject>&) const = 0;
00311 
00316   virtual bool GetTruth (const char *name, bool &isTrue) const = 0;
00317 
00322   virtual bool Remove (const char *name) = 0;
00323 };
00324 
00325 #endif // __CS_IVARIA_SCRIPT_H__

Generated for Crystal Space by doxygen 1.3.9.1