Gets previous attribute, optionally matching attribute name. \param name Name of attribute to find, or 0 to return previous attribute 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 c
| 834 | //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters |
| 835 | //! \return Pointer to found attribute, or 0 if not found. |
| 836 | xml_attribute<Ch> *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const |
| 837 | { |
| 838 | if (name) |
| 839 | { |
| 840 | if (name_size == 0) |
| 841 | name_size = internal::measure(name); |
| 842 | for (xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) |
| 843 | if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) |
| 844 | return attribute; |
| 845 | return 0; |
| 846 | } |
| 847 | else |
| 848 | return this->m_parent ? m_prev_attribute : 0; |
| 849 | } |
| 850 | |
| 851 | //! Gets next attribute, optionally matching attribute name. |
| 852 | //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero |