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

Function importPropertyGroup

lib/importproject.cpp:808–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808static void importPropertyGroup(const tinyxml2::XMLElement *node, std::map<std::string, std::string, cppcheck::stricmp> &variables, std::string &includePath)
809{
810 const char* labelAttribute = node->Attribute("Label");
811 if (labelAttribute && std::strcmp(labelAttribute, "UserMacros") == 0) {
812 for (const tinyxml2::XMLElement *propertyGroup = node->FirstChildElement(); propertyGroup; propertyGroup = propertyGroup->NextSiblingElement()) {
813 const char* name = propertyGroup->Name();
814 const char *text = empty_if_null(propertyGroup->GetText());
815 variables[name] = text;
816 }
817
818 } else if (!labelAttribute) {
819 for (const tinyxml2::XMLElement *propertyGroup = node->FirstChildElement(); propertyGroup; propertyGroup = propertyGroup->NextSiblingElement()) {
820 if (std::strcmp(propertyGroup->Name(), "IncludePath") != 0)
821 continue;
822 const char *text = propertyGroup->GetText();
823 if (!text)
824 continue;
825 std::string path(text);
826 const std::string::size_type pos = path.find("$(IncludePath)");
827 if (pos != std::string::npos)
828 path.replace(pos, 14U, includePath);
829 includePath = std::move(path);
830 }
831 }
832}
833
834static void loadVisualStudioProperties(const std::string &props, std::map<std::string,std::string,cppcheck::stricmp> &variables, std::string &includePath, const std::string &additionalIncludeDirectories, std::list<ItemDefinitionGroup> &itemDefinitionGroupList)
835{

Callers 2

importVcxprojMethod · 0.85

Calls 8

empty_if_nullFunction · 0.85
AttributeMethod · 0.80
FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80
NameMethod · 0.80
GetTextMethod · 0.80
findMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected