| 258 | |
| 259 | |
| 260 | void fs_registrator::script_register(lua_State* L) |
| 261 | { |
| 262 | // |
| 263 | script_register_stdfs(L); |
| 264 | // |
| 265 | module(L)[(class_<FS_item>("FS_item") |
| 266 | .def("NameFull", &FS_item::NameFull) |
| 267 | .def("NameShort", &FS_item::NameShort) |
| 268 | .def("Size", &FS_item::Size) |
| 269 | .def("ModifDigitOnly", &FS_item::TimeWriteDigitOnly) |
| 270 | .def("Modif", &FS_item::TimeWrite), |
| 271 | |
| 272 | class_<FS_file_list_ex>("FS_file_list_ex") |
| 273 | .def("Size", &FS_file_list_ex::Size) |
| 274 | .def("GetAt", &FS_file_list_ex::GetAt) |
| 275 | .def("Sort", &FS_file_list_ex::Sort) |
| 276 | .def( "GetAll", &FS_file_list_ex::GetAll, return_stl_iterator) |
| 277 | , |
| 278 | |
| 279 | class_<FS_file_list>("FS_file_list").def("Size", &FS_file_list::Size).def("GetAt", &FS_file_list::GetAt).def("Free", &FS_file_list::Free), |
| 280 | |
| 281 | /* class_<FS_Path>("FS_Path") |
| 282 | .def_readonly("m_Path", &FS_Path::m_Path) |
| 283 | .def_readonly("m_Root", &FS_Path::m_Root) |
| 284 | .def_readonly("m_Add", &FS_Path::m_Add) |
| 285 | .def_readonly("m_DefExt", &FS_Path::m_DefExt) |
| 286 | .def_readonly("m_FilterCaption", &FS_Path::m_FilterCaption), |
| 287 | */ |
| 288 | class_<CLocatorAPI::file>("fs_file") |
| 289 | .def_readonly("name", &CLocatorAPI::file::name) |
| 290 | .def_readonly("vfs", &CLocatorAPI::file::vfs) |
| 291 | .def_readonly("ptr", &CLocatorAPI::file::ptr) |
| 292 | .def_readonly("size_real", &CLocatorAPI::file::size_real) |
| 293 | .def_readonly("size_compressed", &CLocatorAPI::file::size_compressed) |
| 294 | .def_readonly("modif", &CLocatorAPI::file::time_write), |
| 295 | |
| 296 | class_<CLocatorAPI>("FS") |
| 297 | .enum_("FS_sort_mode")[(value("FS_sort_by_name_up", int(FS_file_list_ex::eSortByNameUp)), value("FS_sort_by_name_down", int(FS_file_list_ex::eSortByNameDown)), |
| 298 | value("FS_sort_by_size_up", int(FS_file_list_ex::eSortBySizeUp)), value("FS_sort_by_size_down", int(FS_file_list_ex::eSortBySizeDown)), |
| 299 | value("FS_sort_by_modif_up", int(FS_file_list_ex::eSortByModifUp)), value("FS_sort_by_modif_down", int(FS_file_list_ex::eSortByModifDown)))] |
| 300 | .enum_("FS_List")[(value("FS_ListFiles", int(FS_ListFiles)), value("FS_ListFolders", int(FS_ListFolders)), value("FS_ClampExt", int(FS_ClampExt)), |
| 301 | value("FS_RootOnly", int(FS_RootOnly)), value("FS_NoLower", int(FS_NoLower)))] |
| 302 | |
| 303 | .def("path_exist", &CLocatorAPI::path_exist) |
| 304 | .def("update_path", &update_path_script) |
| 305 | .def("get_path", &CLocatorAPI::get_path) |
| 306 | .def("append_path", &CLocatorAPI::append_path) |
| 307 | |
| 308 | .def("file_delete", (void(CLocatorAPI::*)(LPCSTR, LPCSTR))(&CLocatorAPI::file_delete)) |
| 309 | .def("file_delete", (void(CLocatorAPI::*)(LPCSTR))(&CLocatorAPI::file_delete)) |
| 310 | |
| 311 | //.def("dir_delete", &dir_delete_script) |
| 312 | //.def("dir_delete", &dir_delete_script_2) |
| 313 | |
| 314 | .def("application_dir", &get_engine_dir) |
| 315 | |
| 316 | .def("file_copy", &CLocatorAPI::file_copy) |
| 317 |
nothing calls this directly
no test coverage detected