diff --git a/appln/main_xodr.cxx b/appln/main_xodr.cxx index 7aa1838..770729b 100644 --- a/appln/main_xodr.cxx +++ b/appln/main_xodr.cxx @@ -11,7 +11,15 @@ int main (int argc , char **argv) xodr _odrive; _odrive.load(filename); - _odrive.parse(); + + try{ + _odrive.parse(); + std::cout << "OpenDRIVE parse successfully " << _odrive.m_OpenDRIVE<< std::endl; + } + catch (std::exception &e) + { + std::cout << "ERROR :Exception .. " << e.what() << std::endl; + } _odrive.save("xodr_save.xml"); diff --git a/appln/main_xosc.cxx b/appln/main_xosc.cxx index 35fca58..f7da41f 100644 --- a/appln/main_xosc.cxx +++ b/appln/main_xosc.cxx @@ -11,7 +11,14 @@ int main (int argc , char **argv) xosc _osc; _osc.load(filename); - _osc.parse(); + try{ + _osc.parse(); + std::cout << "OpenSCENARIO parse successfully " << _osc.m_OpenSCENARIO<< std::endl; + } + catch (std::exception &e) + { + std::cout << "ERROR :Exception .. " << e.what() << std::endl; + } _osc.save("xosc_save.xml"); diff --git a/src/xodr/xodr.cxx b/src/xodr/xodr.cxx index 9ae756e..2c9f5ef 100644 --- a/src/xodr/xodr.cxx +++ b/src/xodr/xodr.cxx @@ -2011,14 +2011,7 @@ void xodr::load(std::string xodrfilename ) } void xodr::parse() { - try { - m_OpenDRIVE = std::make_shared(m_root.child("OpenDRIVE")); - std::cout << "OpenDRIVE parse successfully " << m_OpenDRIVE<< std::endl; - } - catch (std::exception &e) - { - std::cout << "ERROR :Exception .. " << e.what() << std::endl; - } + m_OpenDRIVE = std::make_shared(m_root.child("OpenDRIVE")); } void xodr::save(std::string filename) { diff --git a/src/xodr/xodr.h b/src/xodr/xodr.h index 3b9c77f..1085ec7 100644 --- a/src/xodr/xodr.h +++ b/src/xodr/xodr.h @@ -17,6 +17,7 @@ #include #include #include +#include // #include "pugixml.hpp" #include "common.h" diff --git a/src/xosc/xosc.cxx b/src/xosc/xosc.cxx index 75c3fb0..8af257f 100644 --- a/src/xosc/xosc.cxx +++ b/src/xosc/xosc.cxx @@ -3428,14 +3428,7 @@ void xosc::load(std::string xoscfilename ) } void xosc::parse() { - try { - m_OpenSCENARIO = std::make_shared(m_root.child("OpenSCENARIO")); - std::cout << "OpenSCENARIO parse successfully " << m_OpenSCENARIO<< std::endl; - } - catch (std::exception &e) - { - std::cout << "ERROR :Exception .. " << e.what() << std::endl; - } + m_OpenSCENARIO = std::make_shared(m_root.child("OpenSCENARIO")); } void xosc::save(std::string filename) {