bux API Reference 1.9.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
Loading...
Searching...
No Matches
FsUtil.h
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem> // std::filesystem::path
4#include <ranges> // std::ranges::forward_range<>
5
6namespace bux {
7
8//
9// Function Templates
10//
11std::filesystem::path search_dirs(const std::filesystem::path &in_path, const std::ranges::forward_range auto &dirs)
12{
13 if (!std::filesystem::exists(in_path) && !in_path.has_root_path())
14 for (auto &i: dirs)
15 {
16 const auto concat = i / in_path;
17 if (std::filesystem::exists(concat))
18 return concat;
19 }
20 return in_path;
21}
22
23} // namespace bux
THE common namespace of bux library.
Definition AtomiX.cpp:3
std::filesystem::path search_dirs(const std::filesystem::path &in_path, const std::ranges::forward_range auto &dirs)
Definition FsUtil.h:11