commit 2
This commit is contained in:
parent
28763917ea
commit
5fae85dd35
@ -93,6 +93,8 @@ namespace ui_scripting::lua
|
||||
state["io"]["directoryisempty"] = utils::io::directory_is_empty;
|
||||
state["io"]["listfiles"] = utils::io::list_files;
|
||||
state["io"]["copyfolder"] = utils::io::copy_folder;
|
||||
state["io"]["removefile"] = utils::io::remove_file;
|
||||
state["io"]["removedirectory"] = utils::io::remove_directory;
|
||||
state["io"]["readfile"] = static_cast<std::string(*)(const std::string&)>(utils::io::read_file);
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,11 @@ namespace utils::io
|
||||
return std::filesystem::is_empty(directory);
|
||||
}
|
||||
|
||||
bool remove_directory(const std::string& directory)
|
||||
{
|
||||
return std::filesystem::remove_all(directory);
|
||||
}
|
||||
|
||||
std::vector<std::string> list_files(const std::string& directory)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
|
@ -16,6 +16,7 @@ namespace utils::io
|
||||
bool create_directory(const std::string& directory);
|
||||
bool directory_exists(const std::string& directory);
|
||||
bool directory_is_empty(const std::string& directory);
|
||||
bool remove_directory(const std::string& directory);
|
||||
std::vector<std::string> list_files(const std::string& directory);
|
||||
void copy_folder(const std::filesystem::path& src, const std::filesystem::path& target);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user