| 127 | //============================================================================// |
| 128 | |
| 129 | int LuaVFS::ReadFile(lua_State* L) { |
| 130 | const char* path = luaL_checkstring(L, 1); |
| 131 | std::string modes = luaL_optstring(L, 2, GetReadFilter(path, L)); |
| 132 | modes = BzVFS::allowModes(modes, L2ES(L)->vfsModes->readAllowed); |
| 133 | |
| 134 | std::string data; |
| 135 | if (bzVFS.readFile(path, modes, data)) { |
| 136 | lua_pushstdstring(L, data); |
| 137 | } |
| 138 | else { |
| 139 | lua_pushnil(L); |
| 140 | } |
| 141 | return 1; |
| 142 | } |
| 143 | |
| 144 | |
| 145 | //============================================================================// |
nothing calls this directly
no test coverage detected