From: Joel Rosdahl Date: Fri, 14 Jul 2023 18:33:24 +0000 (+0200) Subject: refactor: Use fs alias for std::filesystem X-Git-Tag: v4.9~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2668883dc8502d89324b0edc75e26085ce57c6e;p=thirdparty%2Fccache.git refactor: Use fs alias for std::filesystem --- diff --git a/src/Util.cpp b/src/Util.cpp index c69f42e38..a24ff3b64 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -51,6 +51,8 @@ using IncludeDelimiter = util::Tokenizer::IncludeDelimiter; +namespace fs = std::filesystem; + namespace { // Process umask, read and written by get_umask and set_umask. @@ -852,8 +854,8 @@ traverse(const std::string& path, const TraverseVisitor& visitor) void traverse(const std::string& path, const TraverseVisitor& visitor) { - if (std::filesystem::is_directory(path)) { - for (auto&& p : std::filesystem::directory_iterator(path)) { + if (fs::is_directory(path)) { + for (auto&& p : fs::directory_iterator(path)) { std::string entry = p.path().string(); if (p.is_directory()) { @@ -863,7 +865,7 @@ traverse(const std::string& path, const TraverseVisitor& visitor) } } visitor(path, true); - } else if (std::filesystem::exists(path)) { + } else if (fs::exists(path)) { visitor(path, false); } else { throw core::Error(