rapidxml

◆ allocate_attribute()

template<class Ch = char>
xml_attribute< Ch > * allocate_attribute ( const Ch * name = 0,
const Ch * value = 0,
std::size_t name_size = 0,
std::size_t value_size = 0 )
inline

Allocates a new attribute from the pool, and optionally assigns name and value to it. If the allocation request cannot be accomodated, this function will throw std::bad_alloc. If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function will call rapidxml::parse_error_handler() function.

Parameters
nameName to assign to the attribute, or 0 to assign no name.
valueValue to assign to the attribute, or 0 to assign no value.
name_sizeSize of name to assign, or 0 to automatically calculate size from name string.
value_sizeSize of value to assign, or 0 to automatically calculate size from value string.
Returns
Pointer to allocated attribute. This pointer will never be NULL.

References xml_base< Ch >::name(), and xml_base< Ch >::value().

Referenced by memory_pool< Ch >::clone_node().