lib: allow that file dependencies are taken from Cppcheck after a check
This commit is contained in:
parent
87a118cd16
commit
8f3d511871
|
@ -338,6 +338,9 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
|
|||
return;
|
||||
}
|
||||
|
||||
// Update the _dependencies..
|
||||
_dependencies.insert( _tokenizer.getFiles()->begin()+1, _tokenizer.getFiles()->end() );
|
||||
|
||||
// call all "runChecks" in all registered Check classes
|
||||
for (std::list<Check *>::iterator it = Check::instances().begin(); it != Check::instances().end(); ++it) {
|
||||
if (_settings.terminated())
|
||||
|
|
|
@ -131,6 +131,13 @@ public:
|
|||
*/
|
||||
void analyseFile(std::istream &f, const std::string &filename);
|
||||
|
||||
/**
|
||||
* @brief Get dependencies. Use this after calling 'check'.
|
||||
*/
|
||||
std::set<std::string> dependencies() const {
|
||||
return _dependencies;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/** @brief Process one file. */
|
||||
|
@ -175,6 +182,7 @@ private:
|
|||
bool _useGlobalSuppressions;
|
||||
std::string _filename;
|
||||
std::string _fileContent;
|
||||
std::set<std::string> _dependencies;
|
||||
|
||||
void reportProgress(const std::string &filename, const char stage[], const unsigned int value);
|
||||
|
||||
|
|
Loading…
Reference in New Issue