Gets last attribute of node, optionally matching attribute name. \param name Name of attribute to find, or 0 to return last 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
| 1043 | //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters |
| 1044 | //! \return Pointer to found attribute, or 0 if not found. |
| 1045 | xml_attribute<Ch> *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const |
| 1046 | { |
| 1047 | if (name) |
| 1048 | { |
| 1049 | if (name_size == 0) |
| 1050 | name_size = internal::measure(name); |
| 1051 | for (xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) |
| 1052 | if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) |
| 1053 | return attribute; |
| 1054 | return 0; |
| 1055 | } |
| 1056 | else |
| 1057 | return m_first_attribute ? m_last_attribute : 0; |
| 1058 | } |
| 1059 | |
| 1060 | /////////////////////////////////////////////////////////////////////////// |
| 1061 | // Node modification |