| 140 | } |
| 141 | |
| 142 | std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, std::size_t fsFileId) |
| 143 | { |
| 144 | std::ifstream fin(Path::join(buildDir, "files.txt")); |
| 145 | if (fin.is_open()) { |
| 146 | const std::string& ret = getAnalyzerInfoFileFromFilesTxt(fin, sourcefile, cfg, fsFileId); |
| 147 | if (!ret.empty()) |
| 148 | return Path::join(buildDir, ret); |
| 149 | } |
| 150 | |
| 151 | const std::string::size_type pos = sourcefile.rfind('/'); |
| 152 | std::string filename; |
| 153 | if (pos == std::string::npos) |
| 154 | filename = sourcefile; |
| 155 | else |
| 156 | filename = sourcefile.substr(pos + 1); |
| 157 | // TODO: is this correct? the above code will return files ending in '.aN'. Also does not consider the ID |
| 158 | return Path::join(buildDir, std::move(filename)) + ".analyzerinfo"; |
| 159 | } |
| 160 | |
| 161 | bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, std::size_t fsFileId, std::size_t hash, std::list<ErrorMessage> &errors, bool debug) |
| 162 | { |