tinyxml2
tinyxml2 copied to clipboard
add FirstDescendantElement and LastDescendantElement functions
The normal way to find a descendent is FirstChildElement()->FirstChildElement() But it lacks the null check, so I added the 2 functions to cover the null check.
The last string of the list should be null, and an empty string in the list matches any child, example: static const char* names[] = { "son", "grandson", nullptr }; FirstDescendantElement(names);
static const char* names[] = { "", "level2", nullptr }; FirstDescendantElement(names);