sfile.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __SFile_H
  2. #define __SFile_H
  3. class SFile;
  4. #include <api/script/script.h>
  5. #include <api/script/objcontroller.h>
  6. #include <api/script/objects/rootobj.h>
  7. #include <api/script/objects/rootobject.h>
  8. #define SFile_SCRIPTPARENT RootObjectInstance
  9. class fileScriptController : public ScriptObjectControllerI {
  10. public:
  11. virtual const wchar_t *getClassName();
  12. virtual const wchar_t *getAncestorClassName();
  13. virtual ScriptObjectController *getAncestorController();
  14. virtual int getNumFunctions();
  15. virtual const function_descriptor_struct *getExportedFunctions();
  16. virtual GUID getClassGuid();
  17. virtual ScriptObject *instantiate();
  18. virtual void destroy(ScriptObject *o);
  19. virtual void *encapsulate(ScriptObject *o);
  20. virtual void deencapsulate(void *o);
  21. private:
  22. static function_descriptor_struct exportedFunction[];
  23. };
  24. extern fileScriptController *fileController;
  25. class SFile : public SFile_SCRIPTPARENT {
  26. public:
  27. SFile();
  28. virtual ~SFile();
  29. void loadfile(const wchar_t *b);
  30. protected:
  31. const wchar_t *filename;
  32. public:
  33. static scriptVar script_vcpu_load(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar fn);
  34. static scriptVar script_vcpu_getSize(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  35. static scriptVar script_vcpu_exists(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  36. };
  37. #endif