From 465001c7ef7479e7cfb7af7af180ed6419a5ab49 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 18 May 2017 19:49:43 +0200 Subject: Finish config parser retrieving device mapping. Change-Id: Ia43f9c0edf09ff9a1c009f198bdad10a6b44b249 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/utils/config-parser.cpp | 7 ++++++- CAN-binder/low-can-binding/utils/config-parser.hpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'CAN-binder/low-can-binding/utils') diff --git a/CAN-binder/low-can-binding/utils/config-parser.cpp b/CAN-binder/low-can-binding/utils/config-parser.cpp index 6f69916..3f33812 100644 --- a/CAN-binder/low-can-binding/utils/config-parser.cpp +++ b/CAN-binder/low-can-binding/utils/config-parser.cpp @@ -23,11 +23,16 @@ 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() diff --git a/CAN-binder/low-can-binding/utils/config-parser.hpp b/CAN-binder/low-can-binding/utils/config-parser.hpp index ce032c9..0453110 100644 --- a/CAN-binder/low-can-binding/utils/config-parser.hpp +++ b/CAN-binder/low-can-binding/utils/config-parser.hpp @@ -29,6 +29,7 @@ namespace utils class config_parser_t { private: + const std::string filepath_; /*!< filepath_ - Path to the config file*/ ini_config config_content_; /*!< config_content_ - Parsed content of INI file.*/ public: @@ -36,6 +37,7 @@ namespace utils config_parser_t(const config_parser_t&) = default; config_parser_t(std::string conf_file); + const std::string& filepath() const; bool check_conf(); const std::vector > get_devices_name(); }; -- cgit 1.2.3-korg