From 21efb74b58479b93f7f7cc7ab7ff34728c2d7912 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 26 May 2022 16:13:07 +0200 Subject: [PATCH] Remove even most boost:: --- components/shader/shadermanager.cpp | 16 ++++++++-------- components/vfs/registerarchives.cpp | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index b15825126a..c4d45a9958 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -7,8 +7,8 @@ #include -#include -#include +#include +#include #include #include @@ -69,7 +69,7 @@ namespace Shader // Recursively replaces include statements with the actual source of the included files. // Adjusts #line statements accordingly and detects cyclic includes. // includingFiles is the set of files that include this file directly or indirectly, and is intentionally not a reference to allow automatic cleanup. - static bool parseIncludes(const boost::filesystem::path& shaderPath, std::string& source, const std::string& fileName, int& fileNumber, std::set includingFiles) + static bool parseIncludes(const std::filesystem::path& shaderPath, std::string& source, const std::string& fileName, int& fileNumber, std::set includingFiles) { // An include is cyclic if it is being included by itself if (includingFiles.insert(shaderPath/fileName).second == false) @@ -96,7 +96,7 @@ namespace Shader return false; } std::string includeFilename = source.substr(start + 1, end - (start + 1)); - boost::filesystem::path includePath = shaderPath / includeFilename; + std::filesystem::path includePath = shaderPath / includeFilename; // Determine the line number that will be used for the #line directive following the included source size_t lineDirectivePosition = source.rfind("#line", foundPos); @@ -116,7 +116,7 @@ namespace Shader lineNumber += std::count(source.begin() + lineDirectivePosition, source.begin() + foundPos, '\n'); // Include the file recursively - boost::filesystem::ifstream includeFstream; + std::ifstream includeFstream; includeFstream.open(includePath); if (includeFstream.fail()) { @@ -364,8 +364,8 @@ namespace Shader TemplateMap::iterator templateIt = mShaderTemplates.find(templateName); if (templateIt == mShaderTemplates.end()) { - boost::filesystem::path path = (boost::filesystem::path(mPath) / templateName); - boost::filesystem::ifstream stream; + std::filesystem::path path = (std::filesystem::path(mPath) / templateName); + std::ifstream stream; stream.open(path); if (stream.fail()) { @@ -379,7 +379,7 @@ namespace Shader int fileNumber = 1; std::string source = buffer.str(); if (!addLineDirectivesAfterConditionalBlocks(source) - || !parseIncludes(boost::filesystem::path(mPath), source, templateName, fileNumber, {})) + || !parseIncludes(std::filesystem::path(mPath), source, templateName, fileNumber, {})) return nullptr; templateIt = mShaderTemplates.insert(std::make_pair(templateName, source)).first; diff --git a/components/vfs/registerarchives.cpp b/components/vfs/registerarchives.cpp index 4dc44fb25e..5d8d30f0f6 100644 --- a/components/vfs/registerarchives.cpp +++ b/components/vfs/registerarchives.cpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -40,10 +41,10 @@ namespace VFS if (useLooseFiles) { - std::set seen; + std::set seen; for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter) { - if (seen.insert(*iter).second) + if (seen.insert((*iter).c_str()).second) { Log(Debug::Info) << "Adding data directory " << iter->string(); // Last data dir has the highest priority