Move include paths list to Settings class so we can set include paths from GUI.
This commit is contained in:
parent
26358debcf
commit
3132041de3
|
@ -159,7 +159,7 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[])
|
||||||
if (path[path.length()-1] != '/' && path[path.length()-1] != '\\')
|
if (path[path.length()-1] != '/' && path[path.length()-1] != '\\')
|
||||||
path += '/';
|
path += '/';
|
||||||
|
|
||||||
_includePaths.push_back(path);
|
_settings._includePaths.push_back(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include paths
|
// Include paths
|
||||||
|
@ -344,13 +344,13 @@ unsigned int CppCheck::check()
|
||||||
{
|
{
|
||||||
// File content was given as a string
|
// File content was given as a string
|
||||||
std::istringstream iss(_fileContents[ _filenames[c] ]);
|
std::istringstream iss(_fileContents[ _filenames[c] ]);
|
||||||
preprocessor.preprocess(iss, filedata, configurations, fname, _includePaths);
|
preprocessor.preprocess(iss, filedata, configurations, fname, _settings._includePaths);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Only file name was given, read the content from file
|
// Only file name was given, read the content from file
|
||||||
std::ifstream fin(fname.c_str());
|
std::ifstream fin(fname.c_str());
|
||||||
preprocessor.preprocess(fin, filedata, configurations, fname, _includePaths);
|
preprocessor.preprocess(fin, filedata, configurations, fname, _settings._includePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
int checkCount = 0;
|
int checkCount = 0;
|
||||||
|
|
|
@ -141,10 +141,6 @@ private:
|
||||||
/** Current configuration */
|
/** Current configuration */
|
||||||
std::string cfg;
|
std::string cfg;
|
||||||
|
|
||||||
/** List of include paths, e.g. "my/includes/" which should be used
|
|
||||||
for finding include files inside source files. */
|
|
||||||
std::list<std::string> _includePaths;
|
|
||||||
|
|
||||||
std::list<std::string> _xmllist;
|
std::list<std::string> _xmllist;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,10 @@ public:
|
||||||
Default value is 0. */
|
Default value is 0. */
|
||||||
int _exitCode;
|
int _exitCode;
|
||||||
|
|
||||||
|
/** List of include paths, e.g. "my/includes/" which should be used
|
||||||
|
for finding include files inside source files. */
|
||||||
|
std::list<std::string> _includePaths;
|
||||||
|
|
||||||
/** Fill list of automaticly deallocated classes */
|
/** Fill list of automaticly deallocated classes */
|
||||||
void autoDealloc(std::istream &istr);
|
void autoDealloc(std::istream &istr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue