further fixes

This commit is contained in:
ZY4N
2024-12-22 21:52:05 +01:00
parent db8db8f9d7
commit b385b3b1c8
5 changed files with 214 additions and 115 deletions

View File

@@ -115,6 +115,7 @@ std::error_code kitti_loader::load(
continue;
}
// TODO find out if the path splitting is consistent
const auto base_directory = parent_directory(file.substr(0, sep_index));
if (not base_directory) [[unlikely]]
{
@@ -162,14 +163,12 @@ std::error_code kitti_loader::load(
{
const auto file_path = std::string_view{ file.path().c_str() };
const auto extension_begin = file_path.rfind('.');
if (extension_begin == std::string_view::npos or file_path.substr(extension_begin) != ".bin")
if (not file_path.ends_with(".bin"))
{
continue;
}
auto filename_begin = file_path.rfind(fs::path::preferred_separator, extension_begin);
auto filename_begin = file_path.rfind(fs::path::preferred_separator);
filename_begin = filename_begin == std::string_view::npos ? 0 : filename_begin + 1;
const auto filename_only = file_path.substr(filename_begin);