OSFILE.lua 724 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. class "OSFILE"
  2. TYPE_FILE = 0
  3. TYPE_ARCHIVE_FILE = 1
  4. function OSFILE:__index__(name)
  5. if name == "fileType" then
  6. return Polycore.OSFILE_get_fileType(self.__ptr)
  7. end
  8. end
  9. function OSFILE:__set_callback(name,value)
  10. if name == "fileType" then
  11. Polycore.OSFILE_set_fileType(self.__ptr, value)
  12. return true
  13. end
  14. return false
  15. end
  16. function OSFILE:OSFILE(...)
  17. for k,v in pairs(arg) do
  18. if type(v) == "table" then
  19. if v.__ptr ~= nil then
  20. arg[k] = v.__ptr
  21. end
  22. end
  23. end
  24. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  25. self.__ptr = Polycore.OSFILE(unpack(arg))
  26. Polycore.__ptr_lookup[self.__ptr] = self
  27. end
  28. end
  29. function OSFILE:debugDump()
  30. local retVal = Polycore.OSFILE_debugDump(self.__ptr)
  31. end