Break web generator to own cmake.
This commit is contained in:
parent
bd60a28eef
commit
ebd41bf4ee
14 changed files with 121 additions and 45 deletions
|
@ -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
|
||||
|
|
17
src/core/file_utilities/Directory.cpp
Normal file
17
src/core/file_utilities/Directory.cpp
Normal 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;
|
||||
}
|
13
src/core/file_utilities/Directory.h
Normal file
13
src/core/file_utilities/Directory.h
Normal 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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue