Use Boost.Filesystem for the configuration

I'd much rather just use std::filesystem, but since all of
Boost.Process, Boost.DLL Boost.Asio uses its own filesystem library we
need to use it anyways.
This commit is contained in:
Robbert van der Helm
2020-05-15 14:54:42 +02:00
parent d9ff98de84
commit f96c08775a
2 changed files with 11 additions and 14 deletions
+6 -6
View File
@@ -16,7 +16,7 @@
#pragma once
#include <filesystem>
#include <boost/filesystem.hpp>
#include <optional>
/**
@@ -34,13 +34,13 @@
* @return The path to the *file* found, or `std::nullopt` if the file could not
* be found.
*/
template <typename F = bool(const std::filesystem::path&)>
std::optional<std::filesystem::path> find_dominating_file(
template <typename F = bool(const boost::filesystem::path&)>
std::optional<boost::filesystem::path> find_dominating_file(
const std::string& filename,
std::filesystem::path starting_dir,
F predicate = std::filesystem::exists) {
boost::filesystem::path starting_dir,
F predicate = boost::filesystem::exists) {
while (starting_dir != "") {
const std::filesystem::path candidate = starting_dir / filename;
const boost::filesystem::path candidate = starting_dir / filename;
if (predicate(candidate)) {
return candidate;
}