implement save as, save version and file existence check on save

This commit is contained in:
2017-11-05 13:15:41 +00:00
parent b42fbb197a
commit 87df30ff41
5 changed files with 160 additions and 24 deletions

View File

@@ -18,6 +18,24 @@ bool Asset::delete_file(const std::string& path)
return true;
}
bool Asset::exist(std::string path, bool is_asset)
{
if (is_asset)
{
Asset asset;
if (asset.open(path.c_str()))
{
asset.close();
return true;
}
}
else
{
std::ifstream f(path);
return f.is_open();
}
}
std::vector<std::string> Asset::list_files(std::string folder, bool is_asset, const std::string& filter_regex)
{
std::vector<std::string> names;