|
19 | 19 |
|
20 | 20 | void CLuaFileDefs::LoadFunctions ( void ) |
21 | 21 | { |
22 | | - CLuaCFunctions::AddFunction ( "fileCreate", CLuaFileDefs::fileCreate ); |
23 | | - CLuaCFunctions::AddFunction ( "fileExists", CLuaFileDefs::fileExists ); |
24 | | - CLuaCFunctions::AddFunction ( "fileOpen", CLuaFileDefs::fileOpen ); |
25 | | - CLuaCFunctions::AddFunction ( "fileIsEOF", CLuaFileDefs::fileIsEOF ); |
26 | | - CLuaCFunctions::AddFunction ( "fileGetPos", CLuaFileDefs::fileGetPos ); |
27 | | - CLuaCFunctions::AddFunction ( "fileSetPos", CLuaFileDefs::fileSetPos ); |
28 | | - CLuaCFunctions::AddFunction ( "fileGetSize", CLuaFileDefs::fileGetSize ); |
29 | | - CLuaCFunctions::AddFunction ( "fileRead", CLuaFileDefs::fileRead ); |
30 | | - CLuaCFunctions::AddFunction ( "fileWrite", CLuaFileDefs::fileWrite ); |
31 | | - CLuaCFunctions::AddFunction ( "fileFlush", CLuaFileDefs::fileFlush ); |
32 | | - CLuaCFunctions::AddFunction ( "fileClose", CLuaFileDefs::fileClose ); |
33 | | - CLuaCFunctions::AddFunction ( "fileDelete", CLuaFileDefs::fileDelete ); |
34 | | - CLuaCFunctions::AddFunction ( "fileRename", CLuaFileDefs::fileRename ); |
35 | | - CLuaCFunctions::AddFunction ( "fileCopy", CLuaFileDefs::fileCopy ); |
| 22 | + CLuaCFunctions::AddFunction ( "fileCreate", fileCreate ); |
| 23 | + CLuaCFunctions::AddFunction ( "fileExists", fileExists ); |
| 24 | + CLuaCFunctions::AddFunction ( "fileOpen", fileOpen ); |
| 25 | + CLuaCFunctions::AddFunction ( "fileIsEOF", fileIsEOF ); |
| 26 | + CLuaCFunctions::AddFunction ( "fileGetPos", fileGetPos ); |
| 27 | + CLuaCFunctions::AddFunction ( "fileSetPos", fileSetPos ); |
| 28 | + CLuaCFunctions::AddFunction ( "fileGetSize", fileGetSize ); |
| 29 | + CLuaCFunctions::AddFunction ( "fileRead", fileRead ); |
| 30 | + CLuaCFunctions::AddFunction ( "fileWrite", fileWrite ); |
| 31 | + CLuaCFunctions::AddFunction ( "fileFlush", fileFlush ); |
| 32 | + CLuaCFunctions::AddFunction ( "fileClose", fileClose ); |
| 33 | + CLuaCFunctions::AddFunction ( "fileDelete", fileDelete ); |
| 34 | + CLuaCFunctions::AddFunction ( "fileRename", fileRename ); |
| 35 | + CLuaCFunctions::AddFunction ( "fileCopy", fileCopy ); |
| 36 | +} |
| 37 | + |
| 38 | + |
| 39 | +void CLuaFileDefs::AddClass ( lua_State* luaVM ) |
| 40 | +{ |
| 41 | + lua_newclass ( luaVM ); |
| 42 | + |
| 43 | + lua_classfunction ( luaVM, "create", "fileOpen" ); |
| 44 | + lua_classfunction ( luaVM, "destroy", "fileClose" ); |
| 45 | + lua_classfunction ( luaVM, "close", "fileClose" ); |
| 46 | + lua_classfunction ( luaVM, "new", "fileCreate" ); |
| 47 | + |
| 48 | + lua_classfunction ( luaVM, "delete", "fileDelete" ); |
| 49 | + lua_classfunction ( luaVM, "exists", "fileExists" ); |
| 50 | + lua_classfunction ( luaVM, "flush", "fileFlush" ); |
| 51 | + lua_classfunction ( luaVM, "getPos", "fileGetPos" ); |
| 52 | + lua_classfunction ( luaVM, "getSize", "fileGetSize" ); |
| 53 | + lua_classfunction ( luaVM, "isEOF", "fileIsEOF" ); |
| 54 | + lua_classfunction ( luaVM, "read", "fileRead" ); |
| 55 | + lua_classfunction ( luaVM, "rename", "fileRename" ); |
| 56 | + lua_classfunction ( luaVM, "setPos", "fileSetPos" ); |
| 57 | + lua_classfunction ( luaVM, "write", "fileWrite" ); |
| 58 | + lua_classfunction ( luaVM, "copy", "fileCopy" ); |
| 59 | + |
| 60 | + lua_classvariable ( luaVM, "pos", "fileSetPos", "fileGetPos" ); |
| 61 | + lua_classvariable ( luaVM, "size", NULL, "fileGetSize" ); |
| 62 | + lua_classvariable ( luaVM, "isEOF", NULL, "fileIsEOF" ); |
| 63 | + |
| 64 | + lua_registerclass ( luaVM, "File" ); |
36 | 65 | } |
37 | 66 |
|
38 | 67 |
|
|
0 commit comments