implement save as, save version and file existence check on save
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user