38
38
#define PLUGINLIB__CLASS_LOADER_IMP_HPP_
39
39
40
40
#include < cstdlib>
41
+ #include < filesystem>
41
42
#include < list>
42
43
#include < map>
43
44
#include < memory>
52
53
#include " ament_index_cpp/get_resource.hpp"
53
54
#include " ament_index_cpp/get_resources.hpp"
54
55
#include " class_loader/class_loader.hpp"
55
- #include " rcpputils/filesystem_helper.hpp"
56
56
#include " rcpputils/shared_library.hpp"
57
57
#include " rcutils/logging_macros.h"
58
58
@@ -486,7 +486,7 @@ std::string ClassLoader<T>::getClassLibraryPath(const std::string & lookup_name)
486
486
library_name.c_str ());
487
487
for (auto path_it = paths_to_try.begin (); path_it != paths_to_try.end (); path_it++) {
488
488
RCUTILS_LOG_DEBUG_NAMED (" pluginlib.ClassLoader" , " Checking path %s " , path_it->c_str ());
489
- if (rcpputils::fs ::exists (*path_it)) {
489
+ if (std::filesystem ::exists (*path_it)) {
490
490
RCUTILS_LOG_DEBUG_NAMED (" pluginlib.ClassLoader" , " Library %s found at explicit path %s." ,
491
491
library_name.c_str (), path_it->c_str ());
492
492
return *path_it;
@@ -566,12 +566,12 @@ ClassLoader<T>::getPackageFromPluginXMLFilePath(const std::string & plugin_xml_f
566
566
// 2. Extract name of package from package.xml
567
567
568
568
std::string package_name;
569
- rcpputils::fs ::path p (plugin_xml_file_path);
570
- rcpputils::fs ::path parent = p.parent_path ();
569
+ std::filesystem ::path p (plugin_xml_file_path);
570
+ std::filesystem ::path parent = p.parent_path ();
571
571
572
572
// Figure out exactly which package the passed XML file is exported by.
573
573
while (true ) {
574
- if (rcpputils::fs ::exists (parent / " package.xml" )) {
574
+ if (std::filesystem ::exists (parent / " package.xml" )) {
575
575
std::string package_file_path = (parent / " package.xml" ).string ();
576
576
return extractPackageNameFromPackageXML (package_file_path);
577
577
}
@@ -594,7 +594,7 @@ template<class T>
594
594
std::string ClassLoader<T>::getPathSeparator()
595
595
/* **************************************************************************/
596
596
{
597
- return std::string (1 , rcpputils::fs:: kPreferredSeparator );
597
+ return std::string (1 , std::filesystem::path::preferred_separator );
598
598
}
599
599
600
600
@@ -628,7 +628,7 @@ template<class T>
628
628
std::string ClassLoader<T>::joinPaths(const std::string & path1, const std::string & path2)
629
629
/* **************************************************************************/
630
630
{
631
- rcpputils::fs ::path p1 (path1);
631
+ std::filesystem ::path p1 (path1);
632
632
return (p1 / path2).string ();
633
633
}
634
634
0 commit comments