@@ -269,7 +269,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
269269 {
270270 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
271271 pathname = itr->path ().string ();
272- basename = boost::filesystem::basename ( itr->path ());
272+ basename = itr->path (). stem (). string ( );
273273 if (!boost::filesystem::is_directory (itr->status ())
274274 && isValidExtension (extension))
275275 {
@@ -312,7 +312,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
312312 {
313313 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
314314 pathname = itr->path ().string ();
315- basename = boost::filesystem::basename ( itr->path ());
315+ basename = itr->path (). stem (). string ( );
316316 if (!boost::filesystem::is_directory (itr->status ())
317317 && isValidExtension (extension))
318318 {
@@ -327,7 +327,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string
327327 {
328328 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
329329 pathname = itr->path ().string ();
330- basename = boost::filesystem::basename ( itr->path ());
330+ basename = itr->path (). stem (). string ( );
331331 if (!boost::filesystem::is_directory (itr->status ())
332332 && isValidExtension (extension))
333333 {
@@ -368,7 +368,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadPCLZFFiles (const std::string &dir)
368368 {
369369 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ()));
370370 pathname = itr->path ().string ();
371- basename = boost::filesystem::basename ( itr->path ());
371+ basename = itr->path (). stem (). string ( );
372372 if (!boost::filesystem::is_directory (itr->status ())
373373 && isValidExtension (extension))
374374 {
@@ -429,7 +429,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getTimestampFromFilepath (
429429{
430430 // For now, we assume the file is of the form frame_[22-char POSIX timestamp]_*
431431 char timestamp_str[256 ];
432- int result = std::sscanf (boost::filesystem::basename (filepath).c_str (),
432+ int result = std::sscanf (boost::filesystem::path (filepath). stem (). string ( ).c_str (),
433433 " frame_%22s_%*s" ,
434434 timestamp_str);
435435 if (result > 0 )
@@ -971,7 +971,7 @@ pcl::ImageGrabberBase::getCurrentDepthFileName () const
971971 pathname = impl_->depth_pclzf_files_ [impl_->cur_frame_ ];
972972 else
973973 pathname = impl_->depth_image_files_ [impl_->cur_frame_ ];
974- std::string basename = boost::filesystem::basename (pathname);
974+ std::string basename = boost::filesystem::path (pathname). stem (). string ( );
975975 return (basename);
976976}
977977// ////////////////////////////////////////////////////////////////////////////////////////
@@ -983,7 +983,7 @@ pcl::ImageGrabberBase::getPrevDepthFileName () const
983983 pathname = impl_->depth_pclzf_files_ [impl_->cur_frame_ -1 ];
984984 else
985985 pathname = impl_->depth_image_files_ [impl_->cur_frame_ -1 ];
986- std::string basename = boost::filesystem::basename (pathname);
986+ std::string basename = boost::filesystem::path (pathname). stem (). string ( );
987987 return (basename);
988988}
989989
@@ -996,7 +996,7 @@ pcl::ImageGrabberBase::getDepthFileNameAtIndex (std::size_t idx) const
996996 pathname = impl_->depth_pclzf_files_ [idx];
997997 else
998998 pathname = impl_->depth_image_files_ [idx];
999- std::string basename = boost::filesystem::basename (pathname);
999+ std::string basename = boost::filesystem::path (pathname). stem (). string ( );
10001000 return (basename);
10011001}
10021002
0 commit comments