Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef SCRIPT_INFO_HPP
00013 #define SCRIPT_INFO_HPP
00014
00015 #include <squirrel.h>
00016 #include "../misc/countedptr.hpp"
00017
00018 #include "script_config.hpp"
00019
00021 static const int MAX_SL_OPS = 100000;
00023 static const int MAX_CONSTRUCTOR_OPS = 100000;
00025 static const int MAX_CREATEINSTANCE_OPS = 100000;
00027 static const int MAX_GET_OPS = 1000;
00029 static const int MAX_GET_SETTING_OPS = 100000;
00030
00032 class ScriptInfo : public SimpleCountedObject {
00033 public:
00034 ScriptInfo() :
00035 SQ_instance(NULL),
00036 main_script(NULL),
00037 tar_file(NULL),
00038 author(NULL),
00039 name(NULL),
00040 short_name(NULL),
00041 description(NULL),
00042 date(NULL),
00043 instance_name(NULL),
00044 version(0),
00045 url(NULL),
00046 scanner(NULL)
00047 {}
00048 ~ScriptInfo();
00049
00053 const char *GetAuthor() const { return this->author; }
00054
00058 const char *GetName() const { return this->name; }
00059
00063 const char *GetShortName() const { return this->short_name; }
00064
00068 const char *GetDescription() const { return this->description; }
00069
00073 int GetVersion() const { return this->version; }
00074
00078 const char *GetDate() const { return this->date; }
00079
00083 const char *GetInstanceName() const { return this->instance_name; }
00084
00088 const char *GetURL() const { return this->url; }
00089
00093 const char *GetMainScript() const { return this->main_script; }
00094
00098 const char *GetTarFile() const { return this->tar_file; }
00099
00103 bool CheckMethod(const char *name) const;
00104
00108 static SQInteger Constructor(HSQUIRRELVM vm, ScriptInfo *info);
00109
00113 virtual class ScriptScanner *GetScanner() { return this->scanner; }
00114
00118 bool GetSettings();
00119
00123 const ScriptConfigItemList *GetConfigList() const;
00124
00128 const ScriptConfigItem *GetConfigItem(const char *name) const;
00129
00133 SQInteger AddSetting(HSQUIRRELVM vm);
00134
00138 SQInteger AddLabels(HSQUIRRELVM vm);
00139
00143 int GetSettingDefaultValue(const char *name) const;
00144
00145
00146 protected:
00147 class Squirrel *engine;
00148 HSQOBJECT *SQ_instance;
00149 ScriptConfigItemList config_list;
00150
00151 private:
00152 char *main_script;
00153 char *tar_file;
00154 const char *author;
00155 const char *name;
00156 const char *short_name;
00157 const char *description;
00158 const char *date;
00159 const char *instance_name;
00160 int version;
00161 const char *url;
00162
00163 class ScriptScanner *scanner;
00164 };
00165
00166 #endif