1 #ifndef MEDUSA_BITS_IO_XML_HPP_
2 #define MEDUSA_BITS_IO_XML_HPP_
18 std::vector<std::string> path_elements;
19 std::string attribute_name;
20 std::tie(path_elements, attribute_name) =
splitPath(path);
21 char* value =
getString(path_elements, attribute_name);
22 std::stringstream ss(value);
30 std::string XML::get<std::string>(
const std::string& path)
const;
33 void XML::set(
const std::string& path,
const T& value,
bool overwrite) {
34 std::vector<std::string> path_elements;
35 std::string attribute_name;
36 std::tie(path_elements, attribute_name) =
splitPath(path);
38 assert_msg(!
exists(path),
"Attribute on path '%s' already exists with value '%s'. "
39 "Set overwrite=true to overwrite its value.",
40 path,
getString(path_elements, attribute_name));
43 ss << std::setprecision(16) << value;
44 setString(path_elements, attribute_name, ss.str());
49 #endif // MEDUSA_BITS_IO_XML_HPP_