Small rendering cleanup.
This commit is contained in:
parent
d269cc8482
commit
fc44c4c623
13 changed files with 171 additions and 37 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue