35 #include <unordered_map>
38 #include <boost/property_tree/ptree.hpp>
57 EDSReader(std::unordered_map<Address, Entry>& dictionary, std::unordered_map<std::string, Address>& name_to_address);
70 static const bool debug =
false;
73 std::unordered_map<Address, Entry>& m_dictionary;
76 std::unordered_map<std::string, Address>& m_name_to_address;
80 boost::property_tree::ptree m_ini;
83 bool parse_index(
const std::string& section, uint16_t index);
86 bool parse_var(
const std::string& section, uint16_t index, uint8_t subindex,
const std::string& name_prefix =
"");
89 bool parse_array_or_record(
const std::string& section, uint16_t index);
92 std::string parse_regex_error(
const std::regex_constants::error_type& etype,
const std::string element_name)
const;
95 std::string trim(
const std::string& str);
bool import_entries()
Import entries from the EDS file into the given dictionary.
This class allows reading EDS files (like standardized in CiA 306) and inserting all contained entrie...
EDSReader(std::unordered_map< Address, Entry > &dictionary, std::unordered_map< std::string, Address > &name_to_address)
Constructor.
bool load_file(std::string filename)
Loads an EDS file from file system.