2 #ifndef vsl_basic_xml_element_h_ 3 #define vsl_basic_xml_element_h_ 17 #include <vxl_config.h> 19 template<
typename T> std::string
toString(
const T& t)
21 std::stringstream strm;
23 strm << std::fixed << t;
32 :
tag_(std::move(tag)) {}
36 :
tag_(std::move(tag)),
attrs_(std::move(attrs)) {}
48 #if VXL_ADDRESS_BITS != 32 //defined(_WIN32) && defined(_MSC_VER) && !defined(_WIN64) ) // Cannot have this overloading for MSVC or GCC 32-bit build as it collides with size_t 53 bool delete_attribute(std::string attr_name);
59 void x_write(std::ostream& ostr);
68 std::vector<std::pair<std::string, std::string> >
attrs_;
72 #endif // vsl_basic_xml_element_h_ void add_attribute(std::string attr_name, unsigned int value)
void add_attribute(std::string attr_name, std::string value)
overloaded methods to add attribute values.
std::vector< std::pair< std::string, std::string > > attrs_
the node attributes
void x_write_open(std::ostream &ostr)
writes the opening tag for this node to the stream.
void append_cdata(const std::string &cdata)
void add_attribute(std::string attr_name, size_t value)
std::string tag_
the node name
vsl_basic_xml_element(std::string tag)
constructs with a name.
void add_attribute(std::string attr_name, int value)
void x_write(std::ostream &ostr)
std::string cdata_
the text() content of this node
vsl_basic_xml_element(std::string tag, std::vector< std::pair< std::string, std::string > > attrs)
constructs with a name and a list of (attribute,value) pair.
~vsl_basic_xml_element()=default
void x_write_close(std::ostream &ostr)
writes the closing tag for this node to the stream.
void add_attribute(std::string attr_name, float value)
void add_attribute_list(std::vector< std::pair< std::string, std::string > > attrs)
std::string toString(const T &t)