Modify Cppcheck::addFile() only take one file as a parameter.

CLI and GUI already do the directory walking for us and we have list
of files to check. So we were duplicating this directory walking.
Practically doing check again for each file if it is a directory.
Which can take some time with large amount of files.
This commit is contained in:
Kimmo Varis 2011-01-13 23:18:04 +02:00
parent b247d7d56e
commit 4668e19060
2 changed files with 4 additions and 6 deletions

View File

@ -56,14 +56,14 @@ void CppCheck::settings(const Settings &currentSettings)
_settings = currentSettings;
}
void CppCheck::addFile(const std::string &path)
void CppCheck::addFile(const std::string &filepath)
{
getFileLister()->recursiveAddFiles(_filenames, path.c_str());
_filenames.push_back(Path::fromNativeSeparators(filepath));
}
void CppCheck::addFile(const std::string &path, const std::string &content)
{
_filenames.push_back(path);
_filenames.push_back(Path::fromNativeSeparators(path));
_fileContents[ path ] = content;
}

View File

@ -77,10 +77,8 @@ public:
* @param path Relative or absolute path to the file to be checked,
* e.g. "cppcheck.cpp". Note that only source files (.c, .cc or .cpp)
* should be added to the list. Include files are gathered automatically.
* You can also give path, e.g. "src/" which will be scanned for source
* files recursively.
*/
void addFile(const std::string &path);
void addFile(const std::string &filepath);
/**
* @brief Add new unreal file to be checked.