| 898 | } |
| 899 | |
| 900 | void CppCheck::checkPlistOutput(const FileWithDetails& file, const std::vector<std::string>& files) |
| 901 | { |
| 902 | if (!mSettings.plistOutput.empty()) { |
| 903 | const bool slashFound = file.spath().find('/') != std::string::npos; |
| 904 | std::string filename = slashFound ? file.spath().substr(file.spath().rfind('/') + 1) : file.spath(); |
| 905 | // removes suffix from filename when it exists |
| 906 | const std::string noSuffixFilename = filename.substr(0, filename.find('.')); |
| 907 | |
| 908 | // the hash is added to handle when files in different folders have the same name |
| 909 | const std::size_t fileNameHash = std::hash<std::string> {}(file.spath()); |
| 910 | filename = mSettings.plistOutput + noSuffixFilename + "_" + std::to_string(fileNameHash) + ".plist"; |
| 911 | mLogger->openPlist(filename, files); |
| 912 | } |
| 913 | } |
| 914 | |
| 915 | unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::string &cfgname, const CreateTokenListFn& createTokenList) |
| 916 | { |