pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
368 stars 134 forks source link

Expose xml_parse_result for external queryability #98

Open michikommader opened 1 month ago

michikommader commented 1 month ago

Currently, when including libOpenDRIVE in an external project, there is no possibility to elegantly catch XML parsing errors. The reason is that "most pugixml functions have a no-throw exception guarantee" and that libOpenDRIVE itself does not expose any additional exception handling possibility.

Exposing pugi::xml_parse_result as member variable of OpenDriveMap enables handling of parsing errors by querying the xml_parse_status from within the external project.