diff --git a/tesseract_common/include/tesseract_common/serialization.h b/tesseract_common/include/tesseract_common/serialization.h index bd954f86c6a..f62ea45c9c7 100644 --- a/tesseract_common/include/tesseract_common/serialization.h +++ b/tesseract_common/include/tesseract_common/serialization.h @@ -156,6 +156,18 @@ struct Serialization return true; } + template + static bool toArchiveFile(const SerializableType& archive_type, + const std::string& file_path, + const std::string& name = "") + { + fs::path fp(file_path); + if (fp.extension() == serialization::binary::extension::value) + return toArchiveFileBinary(archive_type, file_path, name); + + return toArchiveFileXML(archive_type, file_path, name); + } + template static std::vector toArchiveBinaryData(const SerializableType& archive_type, const std::string& name = "")