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

Function splitcfg

lib/preprocessor.cpp:804–816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804static void splitcfg(const std::string &cfgStr, std::list<std::string> &defines, const std::string &defaultValue)
805{
806 for (std::string::size_type defineStartPos = 0U; defineStartPos < cfgStr.size();) {
807 const std::string::size_type defineEndPos = cfgStr.find(';', defineStartPos);
808 std::string def = (defineEndPos == std::string::npos) ? cfgStr.substr(defineStartPos) : cfgStr.substr(defineStartPos, defineEndPos - defineStartPos);
809 if (!defaultValue.empty() && def.find('=') == std::string::npos)
810 def += '=' + defaultValue;
811 defines.push_back(std::move(def));
812 if (defineEndPos == std::string::npos)
813 break;
814 defineStartPos = defineEndPos + 1U;
815 }
816}
817
818static simplecpp::DUI createDUI(const Settings &mSettings, const std::string &cfgStr, Standards::Language lang)
819{

Callers 1

createDUIFunction · 0.85

Calls 4

sizeMethod · 0.45
findMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected