43 #ifndef XML_HELPER_HPP 44 #define XML_HELPER_HPP 47 #include <boost/lexical_cast.hpp> 48 #include <boost/typeof/typeof.hpp> 51 #define WRITE_XVM(variable, node) (node)->set_attribute(#variable, STR(variable)) 55 #define WRITE_XNVM(variable, value, node) (node)->set_attribute(#variable, value) 58 #define WRITE_XNVM2(name, value, node) (node)->set_attribute(name, value) 62 #define WRITE_VALUE(variable, node) WRITE_XNVM(value, STR(variable), (node)->add_child(#variable)) 65 #define LOAD_XVM(variable, node) \ 66 variable = boost::lexical_cast<BOOST_TYPEOF_TPL(variable)>((node)->get_attribute(#variable)->get_value()) 69 #define LOAD_XVFM(variable, node, field) \ 70 variable = boost::lexical_cast<BOOST_TYPEOF_TPL(variable)>((node)->get_attribute(#field)->get_value()) 73 #define LOAD_XVM_LD(variable, node) variable = strtold(((node)->get_attribute(#variable)->get_value()).c_str(), nullptr) 77 #define LOAD_VALUE(variable, node) \ 78 if((node)->get_name() == #variable) \ 79 (variable) = boost::lexical_cast<BOOST_TYPEOF_TPL(variable)>((node)->get_attribute("value")->get_value()) 83 #define GET_STRING_VALUE(node) STR((node)->get_attribute("value")->get_value()) 85 #define GET_NODE_NAME(node) ((node)->get_name()) 88 #define CE_XVM(variable, node) (node)->get_attribute(#variable) Auxiliary methods for manipulating string.