39#ifndef PCL_COMMON_FILE_IO_IMPL_HPP_
40#define PCL_COMMON_FILE_IO_IMPL_HPP_
42#include <boost/filesystem.hpp>
43#include <boost/range/iterator_range.hpp>
57 if(boost::filesystem::is_directory(p))
59 for(
const auto&
entry : boost::make_iterator_range(boost::filesystem::directory_iterator(p), {}))
61 if (boost::filesystem::is_regular_file(
entry))
63 if (
entry.path().extension() ==
".pcd")
70 std::cerr <<
"Given path is not a directory\n";
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
void getAllPcdFilesInDirectory(const std::string &directory, std::vector< std::string > &file_names)
Find all *.pcd files in the directory and return them sorted.
std::string getFilenameWithoutPath(const std::string &input)
Remove the path from the given string and return only the filename (the remaining string after the la...
std::string getFileExtension(const std::string &input)
Get the file extension from the given string (the remaining string after the last '.
std::string getFilenameWithoutExtension(const std::string &input)
Remove the extension from the given string and return only the filename (everything before the last '...