MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / readXmlPathMatchList

Function readXmlPathMatchList

lib/importproject.cpp:1418–1429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1416}
1417
1418static std::list<std::string> readXmlPathMatchList(const tinyxml2::XMLElement *node, const std::string &path, const char name[], const char attribute[])
1419{
1420 std::list<std::string> ret;
1421 for (const tinyxml2::XMLElement *child = node->FirstChildElement(); child; child = child->NextSiblingElement()) {
1422 if (strcmp(child->Name(), name) != 0)
1423 continue;
1424 const char *attr = attribute ? child->Attribute(attribute) : child->GetText();
1425 if (attr)
1426 ret.emplace_back(PathMatch::joinRelativePattern(path, attr));
1427 }
1428 return ret;
1429}
1430
1431static std::string join(const std::list<std::string> &strlist, const char *sep)
1432{

Callers 1

Calls 6

joinRelativePatternFunction · 0.85
FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80
NameMethod · 0.80
AttributeMethod · 0.80
GetTextMethod · 0.80

Tested by

no test coverage detected