Gets first child node, optionally matching node name. \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero \param name_size Size of name, in characters, or 0 to have size calculated automatically from string \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comp
| 934 | //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters |
| 935 | //! \return Pointer to found child, or 0 if not found. |
| 936 | xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const |
| 937 | { |
| 938 | if (name) |
| 939 | { |
| 940 | if (name_size == 0) |
| 941 | name_size = internal::measure(name); |
| 942 | for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling()) |
| 943 | if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) |
| 944 | return child; |
| 945 | return 0; |
| 946 | } |
| 947 | else |
| 948 | return m_first_node; |
| 949 | } |
| 950 | |
| 951 | //! Gets last child node, optionally matching node name. |
| 952 | //! Behaviour is undefined if node has no children. |
no test coverage detected