| 232 | |
| 233 | |
| 234 | void script_register_stdfs(lua_State* L) |
| 235 | { |
| 236 | using self = stdfs::directory_entry; |
| 237 | |
| 238 | module(L, "stdfs")[(def("VerifyPath", [](const char* path) { VerifyPath(path); }), def("directory_iterator", &directory_iterator), |
| 239 | def("recursive_directory_iterator", &recursive_directory_iterator), |
| 240 | class_<self>("path") |
| 241 | .def(constructor<const char*>()) |
| 242 | // TODO: при необходимости можно будет добавить возможность изменения некоторых свойств. |
| 243 | .property("full_path_name", &get_full_path) |
| 244 | .property("full_filename", &get_full_filename) |
| 245 | .property("short_filename", &get_short_filename) |
| 246 | .property("extension", &get_extension) |
| 247 | .property("last_write_time", &get_last_write_time) |
| 248 | .property("last_write_time_string", &get_last_write_time_string) |
| 249 | .property("last_write_time_string_short", &get_last_write_time_string_short) |
| 250 | .def("exists", (bool(self::*)() const)(&self::exists)) |
| 251 | .def("is_regular_file", (bool(self::*)() const)(&self::is_regular_file)) |
| 252 | .def("is_directory", (bool(self::*)() const)(&self::is_directory)) |
| 253 | .def("file_size", (uintmax_t(self::*)() const)(&self::file_size)))]; |
| 254 | } |
| 255 | //////////////////////////////////////////////////////////////////////////////////////////// |
| 256 | ////////////////////////////// SCRIPT C++17 FILESYSTEM - END /////////////////////////////// |
| 257 | //////////////////////////////////////////////////////////////////////////////////////////// |
no test coverage detected