Small rendering cleanup.

This commit is contained in:
jmsgrogan 2023-01-24 08:57:16 +00:00
parent d269cc8482
commit fc44c4c623
13 changed files with 171 additions and 37 deletions

View file

@ -20,3 +20,21 @@ std::vector<Path> Directory::getFilesWithExtension(const Path& path, const std::
}
return paths;
}
void Directory::createIfNotExisting(const Path& path)
{
Path working_path;
if (std::filesystem::is_directory(path))
{
working_path = path;
}
else
{
working_path = path.parent_path();
}
if (!std::filesystem::exists(working_path))
{
std::filesystem::create_directories(working_path);
}
}

View file

@ -8,6 +8,7 @@ using Path = std::filesystem::path;
class Directory
{
public:
static void createIfNotExisting(const Path& path);
static std::vector<Path> getFilesWithExtension(const Path& path, const std::string& extension, bool recursive=false);
};