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

Function addIncludePathsToList

cli/cmdlineparser.cpp:90–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90static bool addIncludePathsToList(const std::string& fileList, std::list<std::string>& pathNames)
91{
92 std::ifstream files(fileList);
93 if (files) {
94 std::string pathName;
95 while (std::getline(files, pathName)) { // next line
96 if (!pathName.empty()) {
97 pathName = Path::removeQuotationMarks(std::move(pathName));
98 pathName = Path::fromNativeSeparators(std::move(pathName));
99
100 // If path doesn't end with / or \, add it
101 if (!endsWith(pathName, '/'))
102 pathName += '/';
103
104 pathNames.emplace_back(std::move(pathName));
105 }
106 }
107 return true;
108 }
109 return false;
110}
111
112static bool addPathsToSet(const std::string& fileName, std::set<std::string>& set)
113{

Callers 2

addPathsToSetFunction · 0.85
parseFromArgsMethod · 0.85

Calls 3

getlineFunction · 0.85
endsWithFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected