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

Method ItemDefinitionGroup

lib/importproject.cpp:726–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724
725 struct ItemDefinitionGroup : ConditionalGroup {
726 explicit ItemDefinitionGroup(const tinyxml2::XMLElement *idg, std::string includePaths) : ConditionalGroup(idg), additionalIncludePaths(std::move(includePaths)) {
727 for (const tinyxml2::XMLElement *e1 = idg->FirstChildElement(); e1; e1 = e1->NextSiblingElement()) {
728 const char* name = e1->Name();
729 if (std::strcmp(name, "ClCompile") == 0) {
730 enhancedInstructionSet = "StreamingSIMDExtensions2";
731 for (const tinyxml2::XMLElement *e = e1->FirstChildElement(); e; e = e->NextSiblingElement()) {
732 const char * const text = e->GetText();
733 if (!text)
734 continue;
735 const char * const ename = e->Name();
736 if (std::strcmp(ename, "PreprocessorDefinitions") == 0)
737 preprocessorDefinitions = text;
738 else if (std::strcmp(ename, "AdditionalIncludeDirectories") == 0) {
739 if (!additionalIncludePaths.empty())
740 additionalIncludePaths += ';';
741 additionalIncludePaths += text;
742 } else if (std::strcmp(ename, "LanguageStandard") == 0) {
743 if (std::strcmp(text, "stdcpp14") == 0)
744 cppstd = Standards::CPP14;
745 else if (std::strcmp(text, "stdcpp17") == 0)
746 cppstd = Standards::CPP17;
747 else if (std::strcmp(text, "stdcpp20") == 0)
748 cppstd = Standards::CPP20;
749 else if (std::strcmp(text, "stdcpplatest") == 0)
750 cppstd = Standards::CPPLatest;
751 } else if (std::strcmp(ename, "EnableEnhancedInstructionSet") == 0) {
752 enhancedInstructionSet = text;
753 }
754 }
755 }
756 else if (std::strcmp(name, "Link") == 0) {
757 for (const tinyxml2::XMLElement *e = e1->FirstChildElement(); e; e = e->NextSiblingElement()) {
758 const char * const text = e->GetText();
759 if (!text)
760 continue;
761 if (std::strcmp(e->Name(), "EntryPointSymbol") == 0) {
762 entryPointSymbol = text;
763 }
764 }
765 }
766 }
767 }
768
769 std::string enhancedInstructionSet;
770 std::string preprocessorDefinitions;

Callers

nothing calls this directly

Calls 5

FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80
NameMethod · 0.80
GetTextMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected