Add test of resource availability

This commit is contained in:
Bruno Herbelin
2022-04-18 14:01:50 +02:00
parent e512eab1e8
commit 1c8575e40c
2 changed files with 10 additions and 1 deletions

View File

@@ -314,7 +314,7 @@ uint Resource::getTextureImage(const std::string& path, float *aspect_ratio)
std::string Resource::listDirectory()
{
// enter icons directory
// enter directory
auto fs = cmrc::vmix::get_filesystem();
cmrc::directory_iterator it = fs.iterate_directory("");
cmrc::directory_iterator itend = it.end();
@@ -335,3 +335,9 @@ std::string Resource::listDirectory()
return ls;
}
bool Resource::hasPath(const std::string& path)
{
auto fs = cmrc::vmix::get_filesystem();
return fs.exists(path);
}

View File

@@ -35,6 +35,9 @@ namespace Resource
// list files in resource directory
std::string listDirectory();
// tests if a resource path is available
bool hasPath(const std::string& path);
}
#endif /* __RSC_MANAGER_H_ */