rapidxml

◆ allocate_node()

template<class Ch = char>
xml_node< Ch > * allocate_node ( node_type type,
const Ch * name = 0,
const Ch * value = 0,
std::size_t name_size = 0,
std::size_t value_size = 0 )
inline

Allocates a new node 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
typeType of node to create.
nameName to assign to the node, or 0 to assign no name.
valueValue to assign to the node, 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 node. This pointer will never be NULL.

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

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