#pragma once #include namespace pugiext { template inline bool query_attribute(pugi::xml_node& node, const char* aname, _T* value) { auto ds = node.attribute(aname); if (ds) { *value = ds.as_int(); return true; } return false; } template<> inline bool query_attribute(pugi::xml_node& node, const char* aname, float* value) { auto ds = node.attribute(aname); if (ds) { *value = ds.as_float(); return true; } return false; } template<> inline bool query_attribute(pugi::xml_node& node, const char* aname, bool* value) { auto ds = node.attribute(aname); if (ds) { *value = ds.as_bool(); return true; } return false; } template<> inline bool query_attribute(pugi::xml_node& node, const char* aname, std::string* value) { auto ds = node.attribute(aname); if (ds) { *value = ds.as_string(); return true; } return false; } template<> inline bool query_attribute(pugi::xml_node& node, const char* aname, const char** value) { auto ds = node.attribute(aname); if (ds) { *value = ds.as_string(); return true; } return false; } inline bool query_attribute(pugi::xml_node& node, const char* aname, float* value, std::function vconv) { auto ds = node.attribute(aname); if (ds) { *value = vconv(ds.as_float()); return true; } return false; } }