OSFILE.lua 681 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. end
  27. end
  28. function OSFILE:debugDump()
  29. local retVal = Polycore.OSFILE_debugDump(self.__ptr)
  30. end