ivaria/script.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 1999 by Brandon Ehle <[email protected]> 00003 (C) 2003 by Mat Sutcliffe <[email protected]> 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 00027 #include "csutil/scf.h" 00028 00029 struct iString; 00030 00031 SCF_VERSION (iScriptObject, 0, 0, 1); 00032 00043 struct iScriptObject : public iBase 00044 { 00049 virtual bool IsType (const char *) const = 0; 00050 00055 virtual iBase* GetPointer () const = 0; 00056 00061 virtual bool SetPointer (iBase *) = 0; 00062 00069 virtual bool Call (const char *name, const char *format, ...) 00070 CS_GNUC_PRINTF(3, 4) = 0; 00071 00078 virtual bool Call (const char *name, int &ret, const char *fmt, ...) 00079 CS_GNUC_PRINTF(4, 5) = 0; 00080 00087 virtual bool Call (const char *name, float &ret, const char *fmt, ...) 00088 CS_GNUC_PRINTF(4, 5) = 0; 00089 00096 virtual bool Call (const char *name, double &ret, const char *fmt, ...) 00097 CS_GNUC_PRINTF(4, 5) = 0; 00098 00105 virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...) 00106 CS_GNUC_PRINTF(4, 5) = 0; 00107 00114 virtual bool Call (const char *name, csRef<iScriptObject>&, 00115 const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0; 00116 00121 virtual bool Set (const char *name, int data) = 0; 00122 00127 virtual bool Set (const char *name, float data) = 0; 00128 00133 virtual bool Set (const char *name, double data) = 0; 00134 00139 virtual bool Set (const char *name, char const *data) = 0; 00140 00145 virtual bool Set (const char *name, iScriptObject *data) = 0; 00146 00151 virtual bool SetTruth (const char *name, bool isTrue) = 0; 00152 00157 virtual bool Get (const char *name, int &data) const = 0; 00158 00163 virtual bool Get (const char *name, float &data) const = 0; 00164 00169 virtual bool Get (const char *name, double &data) const = 0; 00170 00175 virtual bool Get (const char *name, csRef<iString>&) const = 0; 00176 00181 virtual bool Get (const char *name, csRef<iScriptObject>&) const = 0; 00182 00187 virtual bool GetTruth (const char *name, bool &isTrue) const = 0; 00188 }; 00189 00190 struct iObjectRegistry; 00191 00201 struct iScript : public virtual iBase 00202 { 00203 SCF_INTERFACE (iScript, 1, 0, 0); 00204 00206 CS_DEPRECATED_METHOD virtual bool Initialize (iObjectRegistry *object_reg) = 0; 00207 00209 CS_DEPRECATED_METHOD virtual bool Store (const char* name, void* data, 00210 void* tag) = 0; 00211 00213 virtual bool RunText (const char *text) = 0; 00214 00216 virtual bool LoadModule (const char *name) = 0; 00217 00224 virtual bool Call (const char *name, const char *format, ...) 00225 CS_GNUC_PRINTF(3, 4) = 0; 00226 00233 virtual bool Call (const char *name, int &ret, const char *fmt, ...) 00234 CS_GNUC_PRINTF(4, 5) = 0; 00235 00242 virtual bool Call (const char *name, float &ret, const char *fmt, ...) 00243 CS_GNUC_PRINTF(4, 5) = 0; 00244 00251 virtual bool Call (const char *name, double &ret, const char *fmt, ...) 00252 CS_GNUC_PRINTF(4, 5) = 0; 00253 00260 virtual bool Call (const char *name, csRef<iString>&, const char *fmt, ...) 00261 CS_GNUC_PRINTF(4, 5) = 0; 00262 00269 virtual bool Call (const char *name, csRef<iScriptObject> &ret, 00270 const char *fmt, ...) CS_GNUC_PRINTF(4, 5) = 0; 00271 00278 virtual csRef<iScriptObject> NewObject (const char *type, 00279 const char *ctorFormat, ...) CS_GNUC_PRINTF(3, 4) = 0; 00280 00282 virtual bool Store (const char *name, int data) = 0; 00283 00285 virtual bool Store (const char *name, float data) = 0; 00286 00288 virtual bool Store (const char *name, double data) = 0; 00289 00291 virtual bool Store (const char *name, char const *data) = 0; 00292 00294 virtual bool Store (const char *name, iScriptObject *data) = 0; 00295 00297 virtual bool SetTruth (const char *name, bool isTrue) = 0; 00298 00303 virtual bool Retrieve (const char *name, int &data) const = 0; 00304 00309 virtual bool Retrieve (const char *name, float &data) const = 0; 00310 00315 virtual bool Retrieve (const char *name, double &data) const = 0; 00316 00321 virtual bool Retrieve (const char *name, csRef<iString>&) const = 0; 00322 00327 virtual bool Retrieve (const char *name, csRef<iScriptObject>&) const = 0; 00328 00333 virtual bool GetTruth (const char *name, bool &isTrue) const = 0; 00334 00339 virtual bool Remove (const char *name) = 0; 00340 }; 00341 00342 #endif // __CS_IVARIA_SCRIPT_H__
Generated for Crystal Space by doxygen 1.4.7