wrap_DroppedFile.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Copyright (c) 2006-2015 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #include "wrap_DroppedFile.h"
  21. #include "wrap_File.h"
  22. namespace love
  23. {
  24. namespace filesystem
  25. {
  26. DroppedFile *luax_checkdroppedfile(lua_State *L, int idx)
  27. {
  28. return luax_checktype<DroppedFile>(L, idx, "DroppedFile", FILESYSTEM_DROPPED_FILE_T);
  29. }
  30. static const luaL_Reg functions[] =
  31. {
  32. // Inherits from File.
  33. { "getSize", w_File_getSize },
  34. { "open", w_File_open },
  35. { "close", w_File_close },
  36. { "isOpen", w_File_isOpen },
  37. { "read", w_File_read },
  38. { "write", w_File_write },
  39. { "flush", w_File_flush },
  40. { "eof", w_File_eof },
  41. { "tell", w_File_tell },
  42. { "seek", w_File_seek },
  43. { "lines", w_File_lines },
  44. { "setBuffer", w_File_setBuffer },
  45. { "getBuffer", w_File_getBuffer },
  46. { "getMode", w_File_getMode },
  47. { "getFilename", w_File_getFilename },
  48. { "getExtension", w_File_getExtension },
  49. { 0, 0 }
  50. };
  51. extern "C" int luaopen_droppedfile(lua_State *L)
  52. {
  53. return luax_register_type(L, "DroppedFile", functions);
  54. }
  55. } // filesystem
  56. } // love