Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Boost Filesystem code #2966

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ namespace pcl
std::vector < std::string > strs;
std::vector < std::string > strs_;

#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
boost::split (strs_, file, boost::is_any_of ("_"));
Expand All @@ -127,11 +123,7 @@ namespace pcl

if (extension == "pcd" && strs_[0] == "view")
{
#if BOOST_FILESYSTEM_VERSION == 3
view_filenames.push_back ((itr->path ().filename ()).string());
#else
view_filenames.push_back ((itr->path ()).filename ());
#endif

number_of_views++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ namespace pcl
std::vector < std::string > strs;
std::vector < std::string > strs_;

#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
boost::split (strs_, file, boost::is_any_of ("_"));
Expand All @@ -86,11 +82,7 @@ namespace pcl

if (extension == "pcd" && (strs_[0].compare (view_prefix_) == 0))
{
#if BOOST_FILESYSTEM_VERSION == 3
view_filenames.push_back ((itr->path ().filename ()).string());
#else
view_filenames.push_back ((itr->path ()).filename ());
#endif

number_of_views++;
}
Expand Down Expand Up @@ -134,11 +126,7 @@ namespace pcl
std::vector < std::string > strs;
std::vector < std::string > strs_;

#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
boost::split (strs_, file, boost::is_any_of ("_"));
Expand All @@ -147,12 +135,7 @@ namespace pcl

if (extension == "pcd" && strs_[0] == "view")
{
#if BOOST_FILESYSTEM_VERSION == 3
view_filenames.push_back ((itr->path ().filename ()).string());
#else
view_filenames.push_back ((itr->path ()).filename ());
#endif

number_of_views++;
}
}
Expand Down Expand Up @@ -295,23 +278,13 @@ namespace pcl
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/";
#else
std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/";
#endif

bf::path curr_path = itr->path ();

if (isleafDirectory (curr_path))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + (itr->path ().filename ()).string();
#else
std::string path = rel_path_so_far + (itr->path ()).filename ();
#endif
relative_paths.push_back (path);

}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,7 @@ namespace pcl
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/";
#else
std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/";
#endif

bf::path curr_path = itr->path ();
getModelsInDirectory (curr_path, so_far, relative_paths, ext);
Expand All @@ -187,22 +183,14 @@ namespace pcl
{
//check that it is a ply file and then add, otherwise ignore..
std::vector < std::string > strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if (extension.compare (ext) == 0)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + (itr->path ().filename ()).string();
#else
std::string path = rel_path_so_far + (itr->path ()).filename ();
#endif

relative_paths.push_back (path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string file_name = (itr_in->path ().filename ()).string();
#else
std::string file_name = (itr_in->path ()).filename ();
#endif

std::vector < std::string > strs;
boost::split (strs, file_name, boost::is_any_of ("_"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string file_name = (itr_in->path ().filename ()).string();
#else
std::string file_name = (itr_in->path ()).filename ();
#endif

std::vector < std::string > strs;
boost::split (strs, file_name, boost::is_any_of ("_"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string file_name = (itr_in->path ().filename ()).string();
#else
std::string file_name = (itr_in->path ()).filename ();
#endif

std::vector < std::string > strs;
boost::split (strs, file_name, boost::is_any_of ("_"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>

for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string file_name = (itr_in->path ().filename ()).string();
#else
std::string file_name = (itr_in->path ()).filename ();
#endif

std::vector < std::string > strs;
boost::split (strs, file_name, boost::is_any_of ("_"));
Expand Down
27 changes: 0 additions & 27 deletions apps/3d_rec_framework/src/tools/local_recognition_mian_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,22 @@ getScenesInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{

#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/";
#else
std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/";
#endif
bf::path curr_path = itr->path ();
getScenesInDirectory (curr_path, so_far, relative_paths);
}
else
{
//check that it is a ply file and then add, otherwise ignore..
std::vector < std::string > strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ().filename ());
#endif

boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if (extension == "pcd")
{

#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + (itr->path ().filename ()).string();
#else
std::string path = rel_path_so_far + (itr->path ()).filename ();
#endif

relative_paths.push_back (path);
}
}
Expand Down Expand Up @@ -261,11 +246,7 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/";
#else
std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/";
#endif

bf::path curr_path = itr->path ();
getModelsInDirectory (curr_path, so_far, relative_paths, ext);
Expand All @@ -274,22 +255,14 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector
{
//check that it is a ply file and then add, otherwise ignore..
std::vector < std::string > strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path ().filename ()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if (extension.compare (ext) == 0)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + (itr->path ().filename ()).string();
#else
std::string path = rel_path_so_far + (itr->path ()).filename ();
#endif

relative_paths.push_back (path);
}
Expand Down
10 changes: 0 additions & 10 deletions apps/include/pcl/apps/face_detection/face_detection_apps_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,13 @@ namespace face_detection_apps_utils
{
//check that it is a ply file and then add, otherwise ignore..
std::vector < std::string > strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = (itr->path().filename()).string();
#else
std::string file = (itr->path ()).filename ();
#endif

boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if (extension.compare (ext) == 0)
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + (itr->path().filename()).string();
#else
std::string path = rel_path_so_far + (itr->path ()).filename ();
#endif

relative_paths.push_back (path);
}
}
Expand Down
8 changes: 0 additions & 8 deletions apps/src/openni_grab_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,11 @@ class OpenNIGrabFrame
std::cerr << "directory \"" << path.parent_path () << "\" does not exist!\n";
exit (1);
}
#if BOOST_FILESYSTEM_VERSION == 3
file_name_ = path.stem ().string ();
#else
file_name_ = path.stem ();
#endif
}

std::cout << "dir: " << dir_name_ << " :: " << path.parent_path () << std::endl;
#if BOOST_FILESYSTEM_VERSION == 3
std::cout << "file: " << file_name_ << " :: " << path.stem (). string () << std::endl;
#else
std::cout << "file: " << file_name_ << " :: " << path.stem () << std::endl;
#endif

if (pcd_format == "b" || pcd_format == "all")
format_ |= 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,19 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + itr->path ().filename ().string () + "/";
#else
std::string so_far = rel_path_so_far + itr->path ().filename () + "/";
#endif
bf::path curr_path = itr->path ();
getModelsInDirectory (curr_path, so_far, relative_paths);
}
else
{
std::vector<std::string> strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = itr->path ().filename ().string ();
#else
std::string file = itr->path ().filename ();
#endif
boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if((file.compare (0, 3, "raw") == 0) && extension == "pcd") {
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + itr->path ().filename ().string ();
#else
std::string path = rel_path_so_far + itr->path ().filename ();
#endif
relative_paths.push_back (path);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,19 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector
//check if its a directory, then get models in it
if (bf::is_directory (*itr))
{
#if BOOST_FILESYSTEM_VERSION == 3
std::string so_far = rel_path_so_far + itr->path ().filename ().string () + "/";
#else
std::string so_far = rel_path_so_far + itr->path ().filename () + "/";
#endif
bf::path curr_path = itr->path ();
getModelsInDirectory (curr_path, so_far, relative_paths);
}
else
{
std::vector<std::string> strs;
#if BOOST_FILESYSTEM_VERSION == 3
std::string file = itr->path ().filename ().string ();
#else
std::string file = itr->path ().filename ();
#endif
boost::split (strs, file, boost::is_any_of ("."));
std::string extension = strs[strs.size () - 1];

if((file.compare (0, 3, "raw") == 0) && extension == "pcd") {
#if BOOST_FILESYSTEM_VERSION == 3
std::string path = rel_path_so_far + itr->path ().filename ().string ();
#else
std::string path = rel_path_so_far + itr->path ().filename ();
#endif
relative_paths.push_back (path);
}
}
Expand Down
4 changes: 0 additions & 4 deletions gpu/kinfu/tools/kinfu_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,7 @@ vector<string> getPcdFilesInDir(const string& directory)
if (fs::is_regular_file(pos->status()) )
if (fs::extension(*pos) == ".pcd")
{
#if BOOST_FILESYSTEM_VERSION == 3
result.push_back (pos->path ().string ());
#else
result.push_back (pos->path ());
#endif
cout << "added: " << result.back() << endl;
}

Expand Down
4 changes: 0 additions & 4 deletions gpu/kinfu_large_scale/tools/kinfuLS_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ vector<string> getPcdFilesInDir(const string& directory)
if (fs::is_regular_file(pos->status()) )
if (fs::extension(*pos) == ".pcd")
{
#if BOOST_FILESYSTEM_VERSION == 3
result.push_back (pos->path ().string ());
#else
result.push_back (pos->path ());
#endif
cout << "added: " << result.back() << endl;
}

Expand Down
Loading