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

Method getConfigs

lib/preprocessor.cpp:773–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771
772
773std::set<std::string> Preprocessor::getConfigs() const
774{
775 std::set<std::string> ret = { "" };
776 if (!mTokens.cfront())
777 return ret;
778
779 std::set<std::string> defined = { "__cplusplus" };
780
781 // Insert library defines
782 for (const auto &define : mSettings.library.defines()) {
783
784 const std::string::size_type paren = define.find("(");
785 const std::string::size_type space = define.find(" ");
786 std::string::size_type end = space;
787
788 if (paren != std::string::npos && paren < space)
789 end = paren;
790
791 defined.insert(define.substr(0, end));
792 }
793
794 ::getConfigs(mTokens, defined, mSettings.userDefines, mSettings.userUndefs, ret);
795
796 for (const auto &filedata : mFileCache) {
797 if (!mSettings.configurationExcluded(filedata->filename))
798 ::getConfigs(filedata->tokens, defined, mSettings.userDefines, mSettings.userUndefs, ret);
799 }
800
801 return ret;
802}
803
804static void splitcfg(const std::string &cfgStr, std::list<std::string> &defines, const std::string &defaultValue)
805{

Callers 3

checkInternalMethod · 0.80
getcodeMethod · 0.80
getConfigsStrMethod · 0.80

Calls 3

getConfigsFunction · 0.85
definesMethod · 0.80
findMethod · 0.45

Tested by 2

getcodeMethod · 0.64
getConfigsStrMethod · 0.64