Skip to content

Commit 3efb33d

Browse files
committed
Make codebase compatible with Boost 1.85 deprecation removals.
1 parent 06b389b commit 3efb33d

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

parser/src/pluginhandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void PluginHandler::loadPlugins(std::vector<std::string>& skipParserList_)
4444
++dirIter)
4545
{
4646
if (fs::is_regular_file(dirIter->status()) &&
47-
fs::extension(*dirIter) == util::DynamicLibrary::extension())
47+
fs::path(*dirIter).extension() == util::DynamicLibrary::extension())
4848
{
4949
std::string filename = getPluginName(dirIter->path());
5050

@@ -85,7 +85,7 @@ std::vector<std::string> PluginHandler::getPluginNames() const
8585
++dirIter)
8686
{
8787
if (fs::is_regular_file(dirIter->status()) &&
88-
fs::extension(*dirIter) == util::DynamicLibrary::extension())
88+
fs::path(*dirIter).extension() == util::DynamicLibrary::extension())
8989
{
9090
plugins.push_back(getPluginName(dirIter->path()));
9191
}

plugins/cpp/parser/src/cppparser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ bool CppParser::isSourceFile(const std::string& file_) const
159159
const std::vector<std::string> cppExts{
160160
".c", ".cc", ".cpp", ".cxx", ".o", ".so", ".a"};
161161

162-
std::string ext = fs::extension(file_);
162+
std::string ext = fs::path(file_).extension().string();
163163
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
164164

165165
return std::find(cppExts.begin(), cppExts.end(), ext) != cppExts.end();
@@ -219,7 +219,7 @@ std::map<std::string, std::string> CppParser::extractInputOutputs(
219219
{
220220
for (const std::string& src : sources)
221221
{
222-
std::string extension = fs::extension(src);
222+
std::string extension = fs::path(src).extension().string();
223223
inToOut[src] = src.substr(0, src.size() - extension.size() - 1) + ".o";
224224
}
225225
}
@@ -242,7 +242,7 @@ model::BuildActionPtr CppParser::addBuildAction(
242242

243243
model::BuildActionPtr buildAction(new model::BuildAction);
244244

245-
std::string extension = fs::extension(command_.Filename);
245+
auto extension = fs::path(command_.Filename).extension();
246246

247247
buildAction->command = boost::algorithm::join(command_.CommandLine, " ");
248248
buildAction->type

plugins/cpp/service/src/filediagram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ util::Graph::Node FileDiagram::addNode(
711711
}
712712
else if (fileInfo_.type == "CPP")
713713
{
714-
std::string ext = boost::filesystem::extension(fileInfo_.path);
714+
std::string ext = boost::filesystem::path(fileInfo_.path).extension().string();
715715
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
716716

717717
if (ext == ".cpp" || ext == ".cxx" || ext == ".cc" || ext == ".c")

plugins/dummy/parser/src/dummyparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DummyParser::DummyParser(ParserContext& ctx_): AbstractParser(ctx_)
1717

1818
bool DummyParser::accept(const std::string& path_)
1919
{
20-
std::string ext = boost::filesystem::extension(path_);
20+
auto ext = boost::filesystem::path(path_).extension();
2121
return ext == ".dummy";
2222
}
2323

plugins/git/parser/src/gitparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ util::DirIterCallback GitParser::getParserCallback()
164164
boost::property_tree::ptree pt;
165165
std::string repoFile(versionDataDir + "/repositories.txt");
166166

167-
if (boost::filesystem::is_regular(repoFile))
167+
if (boost::filesystem::is_regular_file(repoFile))
168168
boost::property_tree::read_ini(repoFile, pt);
169169

170170
pt.put(repoId + ".name", path.filename().string());

plugins/git/service/src/gitservice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void GitServiceHandler::getRepositoryList(std::vector<GitRepository>& return_)
151151
std::string repoFile(versionDataDir.string() + "/repositories.txt");
152152
boost::property_tree::ptree pt;
153153

154-
if (!fs::is_regular(repoFile))
154+
if (!fs::is_regular_file(repoFile))
155155
{
156156
LOG(warning) << "Repository file not found in data directory: " << repoFile;
157157
return;

plugins/search/parser/src/searchparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ bool SearchParser::shouldHandle(const std::string& path_)
173173
{
174174
//--- The file is not regular. ---//
175175

176-
if (!fs::is_regular(path_))
176+
if (!fs::is_regular_file(path_))
177177
return false;
178178

179179
//--- The file is excluded by suffix. ---//

webserver/include/webserver/pluginhandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class PluginHandler
4444
for (fs::directory_iterator dirIter(path_); dirIter != endIter; ++dirIter)
4545
{
4646
if (fs::is_regular_file(dirIter->status())
47-
&& fs::extension(*dirIter) == util::DynamicLibrary::extension())
47+
&& fs::path(*dirIter).extension() == util::DynamicLibrary::extension())
4848
{
4949
_dynamicLibraries.emplace_back(util::DynamicLibraryPtr(
5050
new util::DynamicLibrary(dirIter->path().string())));

0 commit comments

Comments
 (0)