stc
Loading...
Searching...
No Matches
src
stc
FileUtil.hpp
Go to the documentation of this file.
1
5
#pragma once
6
7
#include <filesystem>
8
#include <optional>
9
#include <vector>
10
11
namespace
stc::FileUtil
{
12
21
inline
std::optional<std::filesystem::path>
findFile
(
22
const
std::vector<std::filesystem::path>& searchPath,
23
const
std::filesystem::path& filename
24
) {
25
for
(
auto
& path : searchPath) {
26
if
(std::filesystem::is_regular_file(path / filename)) {
27
return
path / filename;
28
}
29
}
30
return
std::nullopt;
31
}
32
33
}
stc::FileUtil
Definition
FileUtil.hpp:11
stc::FileUtil::findFile
std::optional< std::filesystem::path > findFile(const std::vector< std::filesystem::path > &searchPath, const std::filesystem::path &filename)
Definition
FileUtil.hpp:21
Generated by
1.9.8