Break web generator to own cmake.

This commit is contained in:
jmsgrogan 2022-10-03 08:12:38 +01:00
parent bd60a28eef
commit ebd41bf4ee
14 changed files with 121 additions and 45 deletions

View file

@ -5,6 +5,7 @@ list(APPEND core_HEADERS
Color.h
CommandLineArgs.h
loggers/FileLogger.h
file_utilities/Directory.h
file_utilities/File.h
file_utilities/FileFormats.h
StringUtils.h
@ -17,6 +18,7 @@ list(APPEND core_LIB_INCLUDES
CommandLineArgs.cpp
data_structures/Tree.cpp
loggers/FileLogger.cpp
file_utilities/Directory.cpp
file_utilities/File.cpp
file_utilities/FileFormats.cpp
memory/SharedMemory.cpp

View file

@ -0,0 +1,17 @@
#include "Directory.h"
std::vector<Path> Directory::getFilesWithExtension(const Path& path, const std::string& extension)
{
std::vector<Path> paths;
if (std::filesystem::is_directory(path))
{
for (const auto& entry : std::filesystem::directory_iterator(path))
{
if (std::filesystem::is_regular_file(entry) && entry.path().extension() == extension)
{
paths.push_back(entry.path());
}
}
}
return paths;
}

View file

@ -0,0 +1,13 @@
#pragma once
#include <vector>
#include <filesystem>
using Path = std::filesystem::path;
class Directory
{
public:
static std::vector<Path> getFilesWithExtension(const Path& path, const std::string& extension);
};