23 #ifndef PSEN_SCAN_V2_XML_CONFIGURATION_PARSER_H 24 #define PSEN_SCAN_V2_XML_CONFIGURATION_PARSER_H 28 namespace configuration
34 namespace xml_config_parsing
59 auto string_cpy = ro_value;
60 std::swap(string_cpy[0], string_cpy[2]);
61 std::swap(string_cpy[1], string_cpy[3]);
62 return std::stoul(string_cpy,
nullptr, 16);
76 std::vector<unsigned long> vec;
80 for (
size_t i = 0; i < ro_string.length(); i += 4)
82 const auto substr = ro_string.substr(i, 4);
83 if (substr.length() == 4)
89 catch (
const std::exception&
e)
104 #endif // PSEN_SCAN_V2_XML_CONFIGURATION_PARSER_H
XMLConfigurationParserException(const std::string &msg)
Contains the events needed to define and implement the scanner protocol.
unsigned long ro_value_to_uint(const std::string &ro_value)
Converts a quadrupel <ro> value into the respective length in mm.
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
ZoneSetConfiguration parseString(const char *xml)
ZoneSetConfiguration parseFile(const char *filename)
std::vector< unsigned long > ro_string_to_vec(const std::string &ro_string)
Convert string from a <ro> element to values.