Gets first attribute of node, optionally matching attribute name. \param name Name of attribute to find, or 0 to return first 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
| 1023 | //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters |
| 1024 | //! \return Pointer to found attribute, or 0 if not found. |
| 1025 | xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const |
| 1026 | { |
| 1027 | if (name) |
| 1028 | { |
| 1029 | if (name_size == 0) |
| 1030 | name_size = internal::measure(name); |
| 1031 | for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) |
| 1032 | if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) |
| 1033 | return attribute; |
| 1034 | return 0; |
| 1035 | } |
| 1036 | else |
| 1037 | return m_first_attribute; |
| 1038 | } |
| 1039 | |
| 1040 | //! Gets last attribute of node, optionally matching attribute name. |
| 1041 | //! \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 |
no test coverage detected