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

Function isUndefined

lib/preprocessor.cpp:557–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555}
556
557static bool isUndefined(const std::string &cfgStr, const std::set<std::string> &undefined)
558{
559 for (std::string::size_type pos1 = 0U; pos1 < cfgStr.size();) {
560 const std::string::size_type pos2 = cfgStr.find(';',pos1);
561 const std::string def = (pos2 == std::string::npos) ? cfgStr.substr(pos1) : cfgStr.substr(pos1, pos2 - pos1);
562
563 const std::string::size_type eq = def.find('=');
564 if (eq == std::string::npos && undefined.find(def) != undefined.end())
565 return true;
566 if (eq != std::string::npos && undefined.find(def.substr(0,eq)) != undefined.end() && def.substr(eq) != "=0")
567 return true;
568
569 pos1 = (pos2 == std::string::npos) ? pos2 : pos2 + 1U;
570 }
571 return false;
572}
573
574static bool getConfigsElseIsFalse(const std::vector<std::string> &configs_if, const std::string &userDefines)
575{

Callers 1

getConfigsFunction · 0.85

Calls 3

sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected