#include <rapidxml.hpp>
Public Member Functions | |
Ch * | name () const |
void | name (const Ch *name, std::size_t size) |
void | name (const Ch *name) |
std::size_t | name_size () const |
xml_node< Ch > * | parent () const |
Ch * | value () const |
void | value (const Ch *value, std::size_t size) |
void | value (const Ch *value) |
std::size_t | value_size () const |
xml_base () | |
Static Protected Member Functions | |
static Ch * | nullstr () |
Protected Attributes | |
Ch * | m_name |
std::size_t | m_name_size |
xml_node< Ch > * | m_parent |
Ch * | m_value |
std::size_t | m_value_size |
Base class for xml_node and xml_attribute implementing common functions: name(), name_size(), value(), value_size() and parent().
Ch | Character type to use |
Definition at line 648 of file rapidxml.hpp.
rapidxml::xml_base< Ch >::xml_base | ( | ) | [inline] |
Definition at line 657 of file rapidxml.hpp.
Ch* rapidxml::xml_base< Ch >::name | ( | ) | const [inline] |
Gets name of the node. Interpretation of name depends on type of node. Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
Use name_size() function to determine length of the name.
Definition at line 673 of file rapidxml.hpp.
void rapidxml::xml_base< Ch >::name | ( | const Ch * | name, |
std::size_t | size | ||
) | [inline] |
Sets name of node to a non zero-terminated string. See ownership_of_strings.
Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.
Size of name must be specified separately, because name does not have to be zero terminated. Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).
name | Name of node to set. Does not have to be zero terminated. |
size | Size of name, in characters. This does not include zero terminator, if one is present. |
Definition at line 721 of file rapidxml.hpp.
void rapidxml::xml_base< Ch >::name | ( | const Ch * | name | ) | [inline] |
Sets name of node to a zero-terminated string. See also ownership_of_strings and xml_node::name(const Ch *, std::size_t).
name | Name of node to set. Must be zero terminated. |
Definition at line 730 of file rapidxml.hpp.
std::size_t rapidxml::xml_base< Ch >::name_size | ( | ) | const [inline] |
Gets size of node name, not including terminator character. This function works correctly irrespective of whether name is or is not zero terminated.
Definition at line 681 of file rapidxml.hpp.
static Ch* rapidxml::xml_base< Ch >::nullstr | ( | ) | [inline, static, protected] |
Definition at line 778 of file rapidxml.hpp.
xml_node<Ch>* rapidxml::xml_base< Ch >::parent | ( | ) | const [inline] |
Gets node parent.
Definition at line 770 of file rapidxml.hpp.
Ch* rapidxml::xml_base< Ch >::value | ( | ) | const [inline] |
Gets value of node. Interpretation of value depends on type of node. Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
Use value_size() function to determine length of the value.
Definition at line 692 of file rapidxml.hpp.
void rapidxml::xml_base< Ch >::value | ( | const Ch * | value, |
std::size_t | size | ||
) | [inline] |
Sets value of node to a non zero-terminated string. See ownership_of_strings.
Note that node does not own its name or value, it only stores a pointer to it. It will not delete or otherwise free the pointer on destruction. It is reponsibility of the user to properly manage lifetime of the string. The easiest way to achieve it is to use memory_pool of the document to allocate the string - on destruction of the document the string will be automatically freed.
Size of value must be specified separately, because it does not have to be zero terminated. Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated).
If an element has a child node of type node_data, it will take precedence over element value when printing. If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.
value | value of node to set. Does not have to be zero terminated. |
size | Size of value, in characters. This does not include zero terminator, if one is present. |
Definition at line 751 of file rapidxml.hpp.
void rapidxml::xml_base< Ch >::value | ( | const Ch * | value | ) | [inline] |
Sets value of node to a zero-terminated string. See also ownership_of_strings and xml_node::value(const Ch *, std::size_t).
value | Vame of node to set. Must be zero terminated. |
Definition at line 760 of file rapidxml.hpp.
std::size_t rapidxml::xml_base< Ch >::value_size | ( | ) | const [inline] |
Gets size of node value, not including terminator character. This function works correctly irrespective of whether value is or is not zero terminated.
Definition at line 700 of file rapidxml.hpp.
Ch* rapidxml::xml_base< Ch >::m_name [protected] |
Definition at line 784 of file rapidxml.hpp.
std::size_t rapidxml::xml_base< Ch >::m_name_size [protected] |
Definition at line 786 of file rapidxml.hpp.
xml_node<Ch>* rapidxml::xml_base< Ch >::m_parent [protected] |
Definition at line 788 of file rapidxml.hpp.
Ch* rapidxml::xml_base< Ch >::m_value [protected] |
Definition at line 785 of file rapidxml.hpp.
std::size_t rapidxml::xml_base< Ch >::m_value_size [protected] |
Definition at line 787 of file rapidxml.hpp.