Skip to content

Commit eccdbe8

Browse files
authored
replace deprecated boost filesystem extension (#5904)
* replace deprecated boost filesystem extension * fix format error * replace more boost extension functions
1 parent 1b383d9 commit eccdbe8

26 files changed

+32
-32
lines changed

apps/in_hand_scanner/src/offline_integration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pcl::ihs::OfflineIntegration::getFilesFromDirectory(
195195
boost::filesystem::directory_iterator it_end;
196196
for (boost::filesystem::directory_iterator it(path_dir); it != it_end; ++it) {
197197
if (!is_directory(it->status()) &&
198-
boost::algorithm::to_upper_copy(boost::filesystem::extension(it->path())) ==
198+
boost::algorithm::to_upper_copy(it->path().extension().string()) ==
199199
boost::algorithm::to_upper_copy(extension)) {
200200
files.push_back(it->path().string());
201201
}

doc/tutorials/content/sources/vfh_recognition/build_tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ loadFeatureModels (const boost::filesystem::path &base_dir, const std::string &e
7878
pcl::console::print_highlight ("Loading %s (%lu models loaded so far).\n", ss.str ().c_str (), (unsigned long)models.size ());
7979
loadFeatureModels (it->path (), extension, models);
8080
}
81-
if (boost::filesystem::is_regular_file (it->status ()) && boost::filesystem::extension (it->path ()) == extension)
81+
if (boost::filesystem::is_regular_file (it->status ()) && it->path ().extension ().string () == extension)
8282
{
8383
vfh_model m;
8484
if (loadHist (base_dir / it->path ().filename (), m))

gpu/kinfu/tools/kinfu_app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ std::vector<std::string> getPcdFilesInDir(const std::string& directory)
186186

187187
for(; pos != end ; ++pos)
188188
if (fs::is_regular_file(pos->status()) )
189-
if (fs::extension(*pos) == ".pcd")
189+
if (pos->path().extension().string() == ".pcd")
190190
{
191191
result.push_back (pos->path ().string ());
192192
std::cout << "added: " << result.back() << std::endl;

gpu/kinfu_large_scale/tools/kinfuLS_app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ std::vector<std::string> getPcdFilesInDir(const std::string& directory)
136136

137137
for(; pos != end ; ++pos)
138138
if (fs::is_regular_file(pos->status()) )
139-
if (fs::extension(*pos) == ".pcd")
139+
if (pos->path().extension().string() == ".pcd")
140140
{
141141
result.push_back (pos->path ().string ());
142142
std::cout << "added: " << result.back() << std::endl;

gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ main (int argc, char** argv)
436436
std::string extension (".txt");
437437
for (boost::filesystem::directory_iterator it (base_dir); it != boost::filesystem::directory_iterator (); ++it)
438438
{
439-
if(boost::filesystem::is_regular_file (it->status ()) && boost::filesystem::extension (it->path ()) == extension)
439+
if(boost::filesystem::is_regular_file (it->status ()) && it->path ().extension ().string () == extension)
440440
{
441441
pcl::TextureMapping<pcl::PointXYZ>::Camera cam;
442442
readCamPoseFile(it->path ().string (), cam);

gpu/people/tools/people_app.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ std::vector<std::string> getPcdFilesInDir(const std::string& directory)
7878

7979
for(; pos != end ; ++pos)
8080
if (fs::is_regular_file(pos->status()) )
81-
if (fs::extension(*pos) == ".pcd")
81+
if (pos->path().extension().string() == ".pcd")
8282
result.push_back(pos->path().string());
8383

8484
return result;

io/src/ascii_io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pcl::ASCIIReader::readHeader (const std::string& file_name,
9595
PCL_ERROR ("[%s] File %s does not exist.\n", name_.c_str (), file_name.c_str ());
9696
return (-1);
9797
}
98-
if (boost::filesystem::extension (fpath) != extension_)
98+
if (fpath.extension ().string () != extension_)
9999
{
100100
PCL_ERROR ("[%s] File does not have %s extension. \n", name_.c_str(), extension_.c_str());
101101
return -1;

io/src/image_grabber.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
267267
boost::filesystem::directory_iterator end_itr;
268268
for (boost::filesystem::directory_iterator itr (dir); itr != end_itr; ++itr)
269269
{
270-
extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
270+
extension = boost::algorithm::to_upper_copy (itr->path ().extension ().string ());
271271
pathname = itr->path ().string ();
272272
basename = itr->path ().stem ().string ();
273273
if (!boost::filesystem::is_directory (itr->status ())
@@ -310,7 +310,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
310310
// First iterate over depth images
311311
for (boost::filesystem::directory_iterator itr (depth_dir); itr != end_itr; ++itr)
312312
{
313-
extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
313+
extension = boost::algorithm::to_upper_copy (itr->path ().extension ().string ());
314314
pathname = itr->path ().string ();
315315
basename = itr->path ().stem ().string ();
316316
if (!boost::filesystem::is_directory (itr->status ())
@@ -325,7 +325,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
325325
// Then iterate over RGB images
326326
for (boost::filesystem::directory_iterator itr (rgb_dir); itr != end_itr; ++itr)
327327
{
328-
extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
328+
extension = boost::algorithm::to_upper_copy (itr->path ().extension ().string ());
329329
pathname = itr->path ().string ();
330330
basename = itr->path ().stem ().string ();
331331
if (!boost::filesystem::is_directory (itr->status ())
@@ -366,7 +366,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadPCLZFFiles (const std::string &dir)
366366
boost::filesystem::directory_iterator end_itr;
367367
for (boost::filesystem::directory_iterator itr (dir); itr != end_itr; ++itr)
368368
{
369-
extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
369+
extension = boost::algorithm::to_upper_copy (itr->path ().extension ().string ());
370370
pathname = itr->path ().string ();
371371
basename = itr->path ().stem ().string ();
372372
if (!boost::filesystem::is_directory (itr->status ())

outofcore/include/pcl/outofcore/impl/octree_base.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,9 @@ namespace pcl
699699
template<typename ContainerT, typename PointT> bool
700700
OutofcoreOctreeBase<ContainerT, PointT>::checkExtension (const boost::filesystem::path& path_name)
701701
{
702-
if (boost::filesystem::extension (path_name) != OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension)
702+
if (path_name.extension ().string () != OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension)
703703
{
704-
PCL_ERROR ( "[pcl::outofcore::OutofcoreOctreeBase] Wrong root node file extension: %s. The tree must have a root node ending in %s\n", boost::filesystem::extension (path_name).c_str (), OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension.c_str () );
704+
PCL_ERROR ( "[pcl::outofcore::OutofcoreOctreeBase] Wrong root node file extension: %s. The tree must have a root node ending in %s\n", path_name.extension ().string ().c_str (), OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension.c_str () );
705705
return (false);
706706
}
707707

outofcore/include/pcl/outofcore/impl/octree_base_node.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace pcl
151151

152152
if (!boost::filesystem::is_directory (file))
153153
{
154-
if (boost::filesystem::extension (file) == node_index_extension)
154+
if (file.extension ().string () == node_index_extension)
155155
{
156156
b_loaded = node_metadata_->loadMetadataFromDisk (file);
157157
break;
@@ -2050,7 +2050,7 @@ namespace pcl
20502050
const boost::filesystem::path& file = *diter;
20512051
if (!boost::filesystem::is_directory (file))
20522052
{
2053-
if (boost::filesystem::extension (file) == OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension)
2053+
if (file.extension ().string () == OutofcoreOctreeBaseNode<ContainerT, PointT>::node_index_extension)
20542054
{
20552055
thisnode->thisnodeindex_ = file;
20562056
loaded = true;

0 commit comments

Comments
 (0)