X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CAN-binder%2Flow-can-binding%2Futils%2Fconfig-parser.cpp;h=3f338121c7b9d72758f911696386ed6d149ab8d1;hb=e9b00c3af0c469726e32755715a69395ad1d3718;hp=c2528e0c54207fc22bc57c128c0bc120d6683841;hpb=12e680a3c97a2750c657a8c561a79706f3689149;p=apps%2Fagl-service-can-low-level.git diff --git a/CAN-binder/low-can-binding/utils/config-parser.cpp b/CAN-binder/low-can-binding/utils/config-parser.cpp index c2528e0c..3f338121 100644 --- a/CAN-binder/low-can-binding/utils/config-parser.cpp +++ b/CAN-binder/low-can-binding/utils/config-parser.cpp @@ -17,17 +17,22 @@ #include "config-parser.hpp" -#include "../low-can-binding.hpp" +#include "../binding/low-can-hat.hpp" namespace utils { /// @brief constructor using path to file config_parser_t::config_parser_t(std::string conf_file) - : config_content_{} + : filepath_{conf_file}, config_content_{} { config_content_.read_file(conf_file); } + const std::string& config_parser_t::filepath() const + { + return filepath_; + } + /// @brief read the conf_file_ and parse it into an INIReader object /// to search into later. bool config_parser_t::check_conf() @@ -47,14 +52,14 @@ namespace utils /// have to test the returned value. /// /// @return A const vector with string of linux CAN devices. - const std::vector config_parser_t::get_devices_name() + const std::vector > config_parser_t::get_devices_name() { - std::vector devices_name; + std::vector > devices_name; std::map bus_mapping = config_content_.get_keys("CANbus-mapping"); for(const auto& busIt : bus_mapping ) { - devices_name.push_back(busIt.second); + devices_name.push_back(std::make_pair(busIt.first, busIt.second)); } return devices_name;