diff --git a/src/cppcheck.cpp b/src/cppcheck.cpp index 073f9cad9..0e168e29f 100644 --- a/src/cppcheck.cpp +++ b/src/cppcheck.cpp @@ -66,6 +66,12 @@ void CppCheck::addFile(const std::string &path, const std::string &content) _fileContents[ path ] = content; } +void CppCheck::clearFiles() +{ + _filenames.clear(); + _fileContents.clear(); +} + std::string CppCheck::parseFromArgs(int argc, const char* const argv[]) { std::vector pathnames; diff --git a/src/cppcheck.h b/src/cppcheck.h index 1c5cae372..53d6a1ede 100644 --- a/src/cppcheck.h +++ b/src/cppcheck.h @@ -89,6 +89,11 @@ public: */ void addFile(const std::string &path, const std::string &content); + /** + * Remove all files added with addFile() and parseFromArgs(). + */ + void clearFiles(); + /** * Parse command line args and get settings and file lists * from there.